Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!! access combo box query select update

Status
Not open for further replies.

wellerp

Instructor
Mar 1, 2001
3
0
0
US
I am using a data input form that has a combo box with a three column drop down list from a query.
When a row in the three column list is selected, only the first field of the query record is updated in the table.

What I do not know how to do is to have all three fields of the selected list be updated in the table the same time.

Can anyone help me with this?

wellerp
 
Your combobox is only bound to 1 field maximum. If you want to push other column values into other fields you would have to add a bit of code to the combo's AfterUpdate event:
Me.AnotherField = Me.MyComboBoxName.Column(1)
Me.AnotherOtherField = Me.MyComboBoxName.Column(2) etc...
A ComboBoxes column count is zero based so your first field is probably bound to column 1 which is (0) although you can set this to any column you like. Read up on ComboBoxes, bound columns, bound and unbound controls. Gord
ghubbell@total.net
 
You cannot use anything other than the bound column of a combobox. You can use other columns from a listbox. What exactly are you trying to do?
 
JerryDennison: I beg to differ: you can use any column from a combobox as described previously. Try it. I use this method frequently to load up other fields on a form... Gord
ghubbell@total.net
 
ghubbell, this works!! I want to thank you very very much. I think I have tried everthing I could think of, I didn't try the .column(x). I cant remember but I don't think I have seen anthing in the Access help about it. I could get it to work hith any one of the columns, but only one at a time. and again I thank you.
wellerp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top