Combobox Question (1 Viewer)

ckhatch

New member
Local time
Today, 07:03
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
 

RedSkies

Registered User.
Local time
Today, 01:03
Joined
Aug 17, 2000
Messages
48
Instead of Me.[BillTo], use forms![YourFormName]![BillTo]
 

ckhatch

New member
Local time
Today, 07:03
Joined
Feb 11, 2001
Messages
9
Alredy tried that it didnt work
 

KevinM

Registered User.
Local time
Today, 07:03
Joined
Jun 15, 2000
Messages
719
Make sure the combo box is bound to [CustomerID]

HTH
 

ckhatch

New member
Local time
Today, 07:03
Joined
Feb 11, 2001
Messages
9
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).]
 

KevinM

Registered User.
Local time
Today, 07:03
Joined
Jun 15, 2000
Messages
719
I meant, CustomerID in the rowsource, not the ControlSource.

HTH
 

Abby N

Registered User.
Local time
Today, 07:03
Joined
Aug 22, 2000
Messages
123
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
 

ckhatch

New member
Local time
Today, 07:03
Joined
Feb 11, 2001
Messages
9
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

Top Bottom