changing query

  • Thread starter Jean-Paul De Winter
  • Start date
J

Jean-Paul De Winter

Hi,
I have a form with a listbox
The content in this listbox can be changed: or it displays a list of
"Places" or a list of "Names"
So far no problem, works pefectly
On this form I have a subform
This subform is based upon a query (created with the wizard, named XYZ and
based upon "Places" I added this name in the recordsource property)
When I click a name in the listbox, the content of the subform changes with
a requery command.
Initially the query is based upon "Places"
So far, no problem
The problem now is:
When I change the content of the listbox to "Names", the XYZ query no longer
is correct because now the query should be based upon "Names" (... Where
Name_firm="Whatever")
How can I solve this?

Thanks
 
K

karl dewey

If the fields for both queries are the same or you can establish a set of
generic field names suitable for both queries then a union query can do it.
The union query would use criteria from two column combo box of "Places" or
"Names" to determine which part of the union query selects records.

If this is hard to follow then post the SQL of your query and the name of
the form and listbox.
 

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