Results 1 to 7 of 7
  1. #1
    wes9659 is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Location
    Dover, Ohio
    Posts
    88

    Trigger a Report Field Based on Yes in Combo Box


    Let me start this by thanking everyone in advance for their help. I have a report and I want a field in another text box on the report, to show only if “Yes” is selected from a dropdown combo text box in form. I have field set to shrink until it is triggered. However, I only want it to trigger other field, on yes selection. The Combo box with yes and no option is named “Veteran”. Text file to trigger with “yes” is named “Honors”. Please walk me through on how to achieve this. Thank you

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You can either
    - in report code, look back to see if form combo is Yes or not
    - pass value of combo to report as an OpenArgs parameter of DoCmd.OpenReport....
    - either way, you should cover the possibility that the combo has no selection by using Nz function.

    Which way to go kind of depends on whether or not the form is still open when the report is opened. If not, you cannot refer back. I would tend to either make the report control visible or not rather than playing with its height - unless you need to control it based on contents.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    wes9659 is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Location
    Dover, Ohio
    Posts
    88
    I'm really a novice at this could you please elaborate more on what you mean how to do it thank you so much for your assistance

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why isn't there data in report to identify if this is a veteran or not? If there were, an expression in textbox on report:

    =IIf([Veteran], [Honors], Null)

    Otherwise:

    =IIf(Forms!formname!Veteran, [Honors], Null)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    wes9659 is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Location
    Dover, Ohio
    Posts
    88
    Where would you put the if Veteran = “Yes” at? I want it only to trigger on a yes response from the veteran combo box. Thank you once again for taking the time to help me.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Quote Originally Posted by wes9659 View Post
    I'm really a novice at this could you please elaborate more on what you mean how to do it thank you so much for your assistance
    June7 responded with a good point, so that's why I haven't come back before now. I figured you'd be OK from there, but apparently not so I'll see if this comment helps:
    the answer to your latest question is in the post - an expression in textbox on report

    Ideally, supporting data should be part of the query so that it's part of the report. Even better if you simply incorporate the veteran value directly rather than trying to "calculate" it somewhere.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Is this 'Veteran' yes/no value saved into table? If saved then it should be included in the report RecordSource.

    We don't know your data structure so hard to advise specifics.

    Did you try suggested expression?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 06-17-2018, 12:07 AM
  2. Report based on combo boxes
    By Shaun in forum Reports
    Replies: 1
    Last Post: 06-29-2016, 11:03 PM
  3. Update fields using a field trigger
    By G4Stech in forum Import/Export Data
    Replies: 3
    Last Post: 10-23-2014, 02:18 PM
  4. Replies: 11
    Last Post: 10-22-2012, 08:39 AM
  5. Replies: 9
    Last Post: 08-30-2011, 04:08 PM

Tags for this Thread

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