Filter Values in a combo box

oihjk

Registered User.
Local time
Today, 09:06
Joined
Feb 13, 2003
Messages
51
Is it possible to filter the values that are displayed or available to select from in a combo box? What I'm looking to do is on a form have a combo box that looksup data from a PO table; however, only display the PO's that have an AFE Number that is the same as the AFE Number on this form.

PONumber Table

PONumber
Company Name
AFENumber

The form will have a combo box looking to PONumber, it will also have an AFE Number field from another table. I want the combo box to display only those PO's that have a matching AFENumber.
Also when the PO is selected I want the company name associated with it to be pulled as well. I tried searching in the forum and microsoft, but could not find this I may have searched using the wrong terms.

Any help is appreciated.
Eric
 
yup no problem

go into the combo's Row Source. It presents you with a window to build the query for the combo. Just put the criteria in the AFE field that you need.

If that is not a good enough explaination send me an email with the database attached and I will see what I can do for you.

DES

technoweenie@sympatico.ca
 
Thanks, you got me on the right path.

Thanks for that tidbit DES. If anyone's interested, this is what I did.

Added this to the criteria of the AFENumber field in my row source query.
[Forms]![AFENumber]![VarianceLogInput Subform].[Form]![AFENumber]

Then in the got focus event I put this code:

Me.Combo318.Requery

Thanks again for the help DES.

Eric
 
Last edited:
TIP: Try and get in the habit of giving your combo boxes (and other controls) meaningful names...

e.g Combo318 :confused:

Would be better as cboPONumber.

Believe me, you'll be glad you did as your db grows and you start to add more and more codes and expressions.
 

Users who are viewing this thread

Back
Top Bottom