Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Linking data to subforms

Linking data to subforms

Linking data to subforms

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?



RE: Linking data to subforms

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 A. Gilman

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close