From: Musa via AccessMonster.com on 4 Nov 2009 16:23 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/Forums.aspx/access-forms/200911/1
From: John W. Vinson on 4 Nov 2009 17:07 On Wed, 04 Nov 2009 21:23:37 GMT, "Musa via AccessMonster.com" <u40920(a)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]
From: fredg on 4 Nov 2009 17:10 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
From: Musa via AccessMonster.com on 5 Nov 2009 16:18 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/Forums.aspx/access-forms/200911/1
|
Pages: 1 Prev: Limit decimal places without format statement Next: bookmark bug access 2003 |