Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jun 2003
    Location
    New Jersey
    Posts
    103
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Using Same Date in Multiple Queries (Access 2000)

    I have a query that has multiple expressions and fields within the query. Instead of having the user remember to change the date on all the expressions, what I like to do is add the date to one field. When the date is entered. the date within the query will change when the user runs it.

    What I am trying to do is have the user enter a date they want to use for the query. When the date is entered, all the expressions within the query should use the date that was entered. How can I do this? I created a table with a StartDate field. But how do I link it to my other tables if there is no association to any of them?

    Help <img src=/S/bwaaah.gif border=0 alt=bwaaah width=123 height=15>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Using Same Date in Multiple Queries (Access 2000)

    I'd create a form, say frmParameters, with an unbound text box txtDate.
    Set the Format property of txtDate to a date format. 'Medium date' is convenient since it doesn't allow for confusion about the meaning of a date, but you can use whatever you prefer.
    In the queries, refer to
    <code>
    [Forms]![frmParameters]![txtDate]
    </code>
    wherever you need the date, and make sure that the frmParameters form is open when the user needs the result of any of the queries.

  3. #3
    2 Star Lounger
    Join Date
    Jun 2003
    Location
    New Jersey
    Posts
    103
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Using Same Date in Multiple Queries (Access 2000)

    Thank you that worked! But I do have another questions on this.

    On the same form I created the frmParameter, I added a on click button that runs my query. The problem is that it doesn't recognize the txtDate field that I entered into the Date field on the form. Is there a way I can run the report via a form so that the user doesn't have to go into the query itself?

    Thank you!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Using Same Date in Multiple Queries (Access 2000)

    I'm not sure I understand your description and question, but you can use the command button to open a report instead of a query. If the query refers to the text box, the report should do so too.

    If I misunderstood you, please try to explain again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •