Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking data to subforms

Status
Not open for further replies.

bcelliott

Technical User
Sep 10, 2000
1
US
I use a form currently that kicks off a series of querys that processes data into reports, and then sends the reports to the intranet. When I kick off the command button on the form, the code runs but brings up a message box requiring an entry of the data run date. This occurs several times due to multiple tables being run. I would like add a subform that allows the user to enter the date once, and link this back to the various queries used in the processing. Making the subform is easy enough, but I need some advice as to the linking part, i.e. should this be done in code, or will the subform properties allow me to link from there?

Thanks.

bcelliott [sig][/sig]
 
Just declare a golbal variable in a standard module like gRunDate or somthing.

Then you could provide a field (RunDate) on your form for the user to enter a date, in the before update event of the field add some code to test the value if you need to restrict the enterd date, then if ok just set the gRunDate = me.RunDate
Now the global value is available to each of your queries.

John [sig]<p>John A. Gilman<br><a href=mailto:gms@uslink.net>gms@uslink.net</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top