Criteria in Query/Form

G

Guest

Hello,

I have a form that has drop down boxes that asks a user to select from them.
I have three combo boxes and they serve as criteria when opening a form.
How do you make the combo boxes dependent on one another? I.e. here are my
combo boxes:

VendorNumber
InvoiceNumber
Amount

If a certain vendor number is selected from the list....how can I have the
invoicenumber combo box narrowed down to the particular invoices numbers that
relate to that vendor number and not list ALL the invoice numbers?

Thank you!
MN
 
F

fredg

Hello,

I have a form that has drop down boxes that asks a user to select from them.
I have three combo boxes and they serve as criteria when opening a form.
How do you make the combo boxes dependent on one another? I.e. here are my
combo boxes:

VendorNumber
InvoiceNumber
Amount

If a certain vendor number is selected from the list....how can I have the
invoicenumber combo box narrowed down to the particular invoices numbers that
relate to that vendor number and not list ALL the invoice numbers?

Thank you!
MN

Leave the RowSource of the [InvoiceNumber] combo box blank.
Code the [VendorNumber] AfterUpdate event:

[InvoiceNumber].RowSource = "Select TableName.[InvoiceNumber] from
TableName Where TableName.VendorNumber = " & Me![VendorNumber] &
" Order By [VendorNumber];"

Change the field and table names as needed.
The above assumes [VendorNumber] is a Number datatype, not text.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top