Criteria in Query/Form

M

MacNut2004

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.
 
Top