Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004

    Question Unanswered: Query variables ?

    I run a date query which contains a variable...
    via a macro to run subsequant querys.
    <Date()-[DI PF TAT Value]+1
    it prompts for the value for [DI PF TAT Value] to be input.
    That works fine.
    subsequant querys that run the [DI PF TAT Value]
    ALSO prompt for the value to be input.
    this value is constant for the following querys.
    ONLY changes when the macro is re-run.

    Can the value be set within the macro ?

    if so how ?

  2. #2
    Join Date
    Feb 2004
    Chicago, IL
    You might try creating a Make Table query. Have the make table query create a table with the date in it. Something like:

    SELECT [DI PF TAT Value] AS [Value] INTO tblReportParameter;

    This will create a table with one field, Value, and it will be set to what the user entered. Run this query at the beginning of the macro. Then you can have all of the other queries you use look at that value.

    This should work but you might have issues if, the macro takes more than a few seconds to run and two people try to run it at the same time with different parameter values.

  3. #3
    Join Date
    Nov 2004


    Have made a make table query that stores "values"
    DI PF
    DI TC
    DS PF
    DS TC
    SR PF
    SR TC
    changed the criteria " <Date()-[DI PF TAT Value]+1 "
    but get syntax errors.

    can you give an example as to the correct syntax ?

    many thanks

Posting Permissions

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