Combobox Question

ckhatch

New member
Local time
Today, 20:07
Joined
Feb 11, 2001
Messages
9
I have a combobox with the row source creating a select query I need the querys criteria to be set by what is in another field on this form (BillTo) I tried something like this
SELECT worksheet.[PO#], worksheet.OurPartNumber, worksheet.Description, worksheet.CustomerID FROM worksheet WHERE (((worksheet.CustomerID)=Me.[BillTo]));
But it didn't work
 
Instead of Me.[BillTo], use forms![YourFormName]![BillTo]
 
Alredy tried that it didnt work
 
Make sure the combo box is bound to [CustomerID]

HTH
 
How do I do that
Would that not store the data of the customer Id in the combobox boumd field

[This message has been edited by ckhatch (edited 05-04-2001).]
 
I meant, CustomerID in the rowsource, not the ControlSource.

HTH
 
Greetings. This select statement in your Row Source should do it.

SELECT worksheet.[PO#], worksheet.OurPartNumber, worksheet.Description, worksheet.CustomerID
FROM worksheet
WHERE (((worksheet.CustomerID)=[Forms]![FormName]![BillTo]));

However, you also need to code the After Update event of the BillTo field with:

Me.ComboName.Requery

Depending on the way your form is set up you may also need to code the forms On Current event in the same way. Coding both will ensure that Access reruns the combos underlying query whenever the value of BillTo changes or you go to a new record. Hope this helps.

~Abby
 
Alredy tried that and all I get is a blank line in my combobox
But I forgot to mention that the BillTo is also a combobox
 

Users who are viewing this thread

Back
Top Bottom