Automatically input date into a parameter in Access query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djones1961
    New Member
    • Jan 2010
    • 2

    Automatically input date into a parameter in Access query

    I have three querries that I am trying to run from a macro instead of running them one at a time. Each query promts for a date when opened. I would like to be able to enter the date once for all three. I know there must be an easy way to do this, but I can not seem to find it.
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    One method is to bind the criteria of the field in each query to a textbox on a form. Enter the date in the textbox and then each query will open using that date. The drawback is that the form must be open.

    Criteria
    Forms!FormName. TextboxName


    Another method would be a table that only ever has one record in it with a field for each parameter required.

    Then you just join to the desired field in the parameters table in your queries, and arrange that the date parameter (in your case) gets updated before you open the queries


    There must be a million and one ways, which is best?
    It depends on your design requirements.

    Comment

    • djones1961
      New Member
      • Jan 2010
      • 2

      #3
      Thanks

      I went the table route. That was tooooooo easy. Sometimes the easiest is the hardest thing to see. Thanks for the help.

      Comment

      Working...