Limiting information in combobox

G

gvaughn

I have two comboboxes, one shows a list of customers, the other shows a list
of contracts. One customer can have mutliple contracts, but a contract can
only have one customer. I want to limit the contracts in the second combobox
to only the contracts of the customer in the first combobox. I have set the
rowsource of the combobox2 to SELECT ActiveContracts FROM ClientTable WHERE
CLientName = Form.OrderEntryForm.Customer. I belive that it is select all
contracts from the client table where the client name in the table matches
the name in the combox1. The problem is when I run it a parameter value
dialog box comes up and askes for a value for Form.OrderEntryForm.Customer,
WHY? I have already selected a customer. I also set the combobox2 to requery
within the After_Update() for the combobox1. Any other suggestions would be
greatly appreciated.
 
B

Bob Quintal

I have two comboboxes, one shows a list of customers, the other
shows a list of contracts. One customer can have mutliple
contracts, but a contract can only have one customer. I want to
limit the contracts in the second combobox to only the contracts
of the customer in the first combobox. I have set the rowsource of
the combobox2 to SELECT ActiveContracts FROM ClientTable WHERE
CLientName = Form.OrderEntryForm.Customer. I belive that it is
select all contracts from the client table where the client name
in the table matches the name in the combox1. The problem is when
I run it a parameter value dialog box comes up and askes for a
value for Form.OrderEntryForm.Customer, WHY? I have already
selected a customer. I also set the combobox2 to requery within
the After_Update() for the combobox1. Any other suggestions would
be greatly appreciated.

WHY?
BECAUSE!
Form.OrderEntryForm.Customer is not how you need to refer to the
textbox named Customer on form OrderEntryForm

in the query try
Forms!OrderEntryForm!Customer
 
A

albert williams

gvaughn said:
I have two comboboxes, one shows a list of customers, the other shows a
list
of contracts. One customer can have mutliple contracts, but a contract can
only have one customer. I want to limit the contracts in the second
combobox
to only the contracts of the customer in the first combobox. I have set
the
rowsource of the combobox2 to SELECT ActiveContracts FROM ClientTable
WHERE
CLientName = Form.OrderEntryForm.Customer. I belive that it is select all
contracts from the client table where the client name in the table matches
the name in the combox1. The problem is when I run it a parameter value
dialog box comes up and askes for a value for
Form.OrderEntryForm.Customer,
WHY? I have already selected a customer. I also set the combobox2 to
requery
within the After_Update() for the combobox1. Any other suggestions would
be
greatly appreciated.
 

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