If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
combo box and saving to table
I can select 1 value from a 2 column combo box and save it....no problem. I
can even display the 2nd value of the combo box in a text field. But, is there a way to select 2 values from the combo box and save column(0) to one field and column(1) to another field in the same table ? For Example, ID -- 10 Name --- ABC Company It saves as: ID Name 10 ABC Company I know this is against normalization and it would be redundant data, but can it still be done..? Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200911/1 |
#2
|
|||
|
|||
combo box and saving to table
On Wed, 04 Nov 2009 21:23:37 GMT, "Musa via AccessMonster.com" u40920@uwe
wrote: I can select 1 value from a 2 column combo box and save it....no problem. I can even display the 2nd value of the combo box in a text field. But, is there a way to select 2 values from the combo box and save column(0) to one field and column(1) to another field in the same table ? For Example, ID -- 10 Name --- ABC Company It saves as: ID Name 10 ABC Company I know this is against normalization and it would be redundant data, but can it still be done..? Thanks You're right, it's almost certainly a Bad Idea (what if ABC Company gets bought out and becomes Steele, Robb and Plundre)? but... Use the AfterUpdate event of the combo to "push" data into a textbox bound to the other field: Private Sub cboCompany_AfterUpdate() Me!CompanyName = Me!cboCompany.Column(1) End Sub using the first column as the bound column... -- John W. Vinson [MVP] |
#3
|
|||
|
|||
combo box and saving to table
On Wed, 04 Nov 2009 21:23:37 GMT, Musa via AccessMonster.com wrote:
I can select 1 value from a 2 column combo box and save it....no problem. I can even display the 2nd value of the combo box in a text field. But, is there a way to select 2 values from the combo box and save column(0) to one field and column(1) to another field in the same table ? For Example, ID -- 10 Name --- ABC Company It saves as: ID Name 10 ABC Company I know this is against normalization and it would be redundant data, but can it still be done..? Thanks 1) You're correct....This is redundant data and should not be done. 2) However, if you had some compelling business reason, code the Combo box AfterUpdate event: Me.[Name] = Me.ComboName.Column(1) The field Name should be included on the form. 3) See #1 Note: I hope you do NOT have a field named "Name" in your table. Name is a reserved keyword and should not be used as a field name. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#4
|
|||
|
|||
combo box and saving to table
No, field is labelled Name... Thanks for your suggestion.
fredg wrote: I can select 1 value from a 2 column combo box and save it....no problem. I can even display the 2nd value of the combo box in a text field. But, is [quoted text clipped - 10 lines] Thanks 1) You're correct....This is redundant data and should not be done. 2) However, if you had some compelling business reason, code the Combo box AfterUpdate event: Me.[Name] = Me.ComboName.Column(1) The field Name should be included on the form. 3) See #1 Note: I hope you do NOT have a field named "Name" in your table. Name is a reserved keyword and should not be used as a field name. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200911/1 |
Thread Tools | |
Display Modes | |
|
|