View Single Post
  #2  
Old May 21st, 2010, 10:18 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default show 2nd field when combo box choice is made

Set up your combobox using the wizard and include the fields you need, from
Left-to-Right.

If in the Combobox they appear as

Product Price

the code would be

Private Sub YourComboBoxName_AfterUpdate()
Me.SubformPriceField = Me.YourComboBoxName.Column(1)
End Sub

The column index is zero based, so the first column would have an index of 0
(zero). You sound as if your combobox is bound so that the Product is saved
directly to your underlying table, but if you wanted to assign the Product to
a textbox, you would use

Me.SubformProductField = Me.YourComboBoxName.Column(0)

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1