View Full Version : Help on Sub-Query parameters - how to do this?


Ricki
03-07-2002, 08:45 AM
This has me stumped:

1) form "frmMain" collects user criteria then invokes form "frmResult".

1) frmResult is a form based on query "qryResult".

2) qryResult is a query based on 2 sub-queries "qryData1" and "qryData2" (does a join of their data then some summing).

What is now needed is that the sub-queries have to be changed to accept parameter data collected by frmMain.

Anyone have any idea how data in frmMain can be 'fed' thru to the sub-queries?

Regards,
Ricki

David R
03-07-2002, 09:37 AM
You can refer to form fields as long as the form is open (in other words, don't close it before you open the new form). Use the full format to refer to it, Forms![MyForm].[MyUnboundField], etc...

HTH,
David R

Ricki
03-07-2002, 11:29 AM
wow - so simple (I'm embarassed). Thanks David.

David R
03-07-2002, 02:00 PM
Don't be embarassed. It's only easy when you know where to look (if you don't believe that, try looking up my original post back in October 2001).

Good luck,
David R

jdanna54
03-08-2002, 11:51 AM
OK, Now I am more confused. Here is what I have.
In order:
qryfollowup (prompts for information from many tables, Division field, and from another table Startdate and Enddate of the followup.

Then, so people can view the information before printing it, I created a form
frmclfollowup. This form neatly displays the information based off of qryfollowup.

On this form I placed a button to print the report. rptclfollowup. It works, however, the report is based off of the same query as the form, therefore I must answer the same 3 questions as I answered to display the form to print this report. I do not want the users to have to do this. Is there code that I could add to the command button to extract the data already collected in the form so that when the user clicks the print button it just prints? I am in the beginning stages of creating my own dbases so I do not know alot about programming language, just enough to be dangerous.