Lots of queries - One form

DJ_DEF_CON_1

Registered User.
Local time
Today, 03:27
Joined
Jan 1, 2003
Messages
40
I have created about a dozen queries that pull up a variety of information. The only similarity between all the queries is that they filter by a date range. I have created a form where I can filter by the date range. What I would like is to create a "Refresh" button that will run all the queries and display the results in text boxes. When i run the wueries on their own I get results. When I run them from the form I get nothing. Is it because I have too many queries?

Any information that you can supply would be very helpful?

Thanks
 
The only solution that springs to mind is a main form where you enter your dates and then 12 subforms, each based on one of the queries... There may be other ways to do this as I am not sure where the data is coming from in the queries (all from the same table?), etc. This could have a bearing on how you approach a solution... (You could combine the queries into in, but that might be a bit horrendous depending on the amount of data each query returns.)

hth,
Jack
 
Thanks for your help
 
Another possibility is that your queries are returning more then one value which can't be represented in a text box. You may be able to do this using multiple combo or list boxes instead of text boxes and then setting the rowsource for each one in the on-click event for the command button that you are clicking.

Example:

me.combobox1.rowsource = "YourQuery1Name"
me.combobox2.rowsource = "YourQuery2Name"
etc.....

Combobox1 and combobox2 are the names of your combobox and YourQuery1Name and YourQuery2Name are the names of the queries that you run to fill those boxes.

I believe this should work.

HTH
 
I have each query only returning one record.

I am basically retrieving information from various other databases for my boss who wants to see all this data on one form. I have linked to the other databases, and got the queries working well. He would like to enter a date range, which I have working, hit a button and eventually (Crap loads of data to go through) return what he is looking for. I have been retrieving this information manually right now (Running each query one by one)

This group of people have been very helpful to me and my "rookiness".

I cannot put the database online as some of the tables I link to are through "ODBC"

Any further information any of you could add would be greatly appreciated.
 
I'm not sure how to set the control source of a textbox to the results of a query, but what you could do is use the DLookup function for each text box to find what you need.

Example

txtBox1 = Dlookup("FieldNameInQuery","QueryName")
txtBox2 = DLookup("FieldNameInQuery2","queryName2")

Then do that for each textbox you are using. I'm not sure how it will do with time/performance issues, but it will work.

HTH
 

Users who are viewing this thread

Back
Top Bottom