HELP!! 2 combo boxes on form

CherylStraw

New member
Local time
Today, 08:59
Joined
Jun 4, 2001
Messages
6
I have created a form that has information for a table called CALLS. What I need to do is create a combo box to look up the customer name from a table (which I have done)and when that customer name is typed in automatically fill in the location ID for that customer. I have tried every thing I can think of do accomplish this. Let me know if you need more info. Any help would be greatly appeciated!!!!
 
If the table that has the Customer Name in it also has the LocationID then create your combo box so the LocationID is the first column in the combo box and the CustomerName the second. Do this with the Wizard as it is easier. Then in the After Update event of the combo box put code like this:

Me.LocationID = Me.ComboBoxName.Column(0)

If your LocationID is in another table then you will need code like this in the After Update event assuming that the Combo box only has one column.

Me.LocationID = DLookup("[LocationID]","tblCustomers]", "[CustomerName] = '" & Me.ComboBoxName & "'")
 
Jack,

Thanks for the reply. I tried this and it worked with the exception of the information that goes into the table under the field called "Company Name" is the location ID and under the location ID field it is the location ID again. Can you tell me what I am doing wrong?
 

Users who are viewing this thread

Back
Top Bottom