Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2020
    Posts
    10

    Display Parameter on Form or Report

    I use a parameter query to tell me what age animals will be at a random projected date in the future. I would like to be able to see what parameter I typed on the resultant form or report. Is this possible? Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Presuming you used something like [Enter date], a textbox with a control source of:

    =[Enter date]

    should show it and not prompt again, presuming you use the exact same text as the criteria.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Oh, you can also mix text in:

    ="Report run for: " & [Enter date]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Join Date
    Sep 2020
    Posts
    10
    Hi Paul and thanks for the tip. It didn't work for me - it asked me twice for the parameter instead. I created a text box saying =[Enter Required Date]
    This is what I have in my query:
    ProjectedAge: DateDiff("yyyy",[BirthDate],[Enter Required Date])-IIf(Format([BirthDate],"mmdd")>Format([Enter Required Date],"mmdd"),1,0)
    Can you see any problems with it? Thanks again for your time.

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If the spelling is exactly the same you shouldn't get prompted twice. Without the textbox you only get one prompt? Can you attach the db he Really?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Join Date
    Sep 2020
    Posts
    10
    Hi Paul and thanks again for your help,
    I had tried using [Enter Required Date] on a report, which is where it prompted me twice. Yes, without the textbox I only get one prompt, and the query works. I made a form based on the same query, and tried putting the same text box on that, both in the header then in the detail section. Instead of prompting me twice, it came up with the message #name? I can't attach the database as even without data and with Compact and Repair it is 11Mb, who knows why! Look this isn't a big deal, it just would have saved me wondering if I'd typed the correct date.
    Cheers Helen

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    in your query, you need to include [Enter Date] as a column on your query (no criteria) - something like

    SELECT *,[Enter Date]
    FROM myTable
    WHERE someDate=[Enter Date]

  8. #8
    Join Date
    Sep 2020
    Posts
    10
    Hi Ajax and thank you too for your contribution. I am still having no luck, please put it down to my novice status rather than your and Paul's advice. I'll post here if and when I get it to work.
    Cheers Helen

  9. #9
    Join Date
    Sep 2020
    Posts
    10
    Hi again Ajax and Paul and thanks for your helpon this problem. I was able to screen share with the lovely gurus at MelbPC Users, and they nudged me in the rightdirection, which was where you were already pushing me!
    I created two new fields in theunderlying query’s Design Grid:
    ReqdDate: [Enter Required Date]
    ProjectedAgeateDiff("yyyy",[BirthDate],[ReqdDate])-IIf(Format([BirthDate],"mmdd")>Format([ReqdDate],"mmdd"),1,0)
    Then we put the ReqdDate field in theheader of my report. Voila!
    Thanks again, Helen

  10. #10
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Glad you got it sorted.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Display a query parameter on a report
    By tfbalogh in forum Access
    Replies: 2
    Last Post: 06-30-2017, 12:54 PM
  2. Replies: 7
    Last Post: 03-10-2013, 11:29 AM
  3. Replies: 1
    Last Post: 11-21-2011, 03:22 PM
  4. Replies: 6
    Last Post: 02-20-2009, 11:50 AM
  5. Replies: 4
    Last Post: 01-05-2006, 02:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums