Linking query to list box on form

  • Thread starter Thread starter Toan Chau
  • Start date Start date
T

Toan Chau

Greetings!

I have a query that prompts for an input because I've
entered [What CSR?] in the criteria field.

When I create a chart based on this field in a form, it
prompts me "What CSR?" and I enter a vaule and it works
fine.

My question is, can I link the [What CSR?], from the
query, to a list box on the form with choices? So when I
select different choices in the list box the graph would
update and change?

That way I don't have to type in an answer to [What
CSR?]. Instead I can select it from a list in the list
box.

All help that you supply me are tax deductable!

Thanks!
 
Rather than have the query include a prompt for a parameter ("[What CSR?]"),
you can create a form with your listbox (or a combo box), then have the
query's criterion refer to that control on that form.

It will only work if the form is open.
 
Can you give me summary of the steps?

What I tired to do--and it didn't work, was...

1) Right click on the field in the query and choose
lookup "listbox".

Is this correct?

Thanks again.

--Toan
 
Ahhh! ?You have a lookup type data field involved? If so, be aware that
regular discussions in the tablesdbdesign newsgroup recommend against using
that type of field, because of the confusions it causes.
 
Toan

You can refer to the value of a combo box in a query using the following syntax
[Forms]![FormName]![cboName

This also works for text boxes etc
The form must be open for the query to work..
Make sure to include a way to update the chart when the combo is changed

Tim
 
Back
Top