Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reference Query Parameters (97SR2)

    How do I reference query parameters in a report?

    I have a query set up to take two parameter: a begging date and ending date. I'd like to put the value of those parameters into the report header. How can I reference those parameters so they show up in the header?

    (Rory, you're on a roll. Care to take a shot at this one too?)
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Reference Query Parameters (97SR2)

    Yup! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Stick a text box into the report header and set its control source to =[beginning date] or whatever your parameter name is. You could also set it to something like ="Between " & [beginning date] & " and " & [end date] if you wanted.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reference Query Parameters (97SR2)

    It works only if I leave off the [ ] brackets. That was my problem before. I kept getting prompted for the parameters twice (once in the query and then again in the report). When I tried without the brackets:

    beginning date:

    ...it worked! Thanks for you support!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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