Results 1 to 5 of 5
  1. #1
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146

    make label visible on opening report


    So I am trying to use VBA to unhide a label on a report when the situation warrants it.

    I set a variable before opening the report.

    I have code to open the report to a specific record and then in the Report Open event I make label visible based on the previously set variable, only it doesn't work.

    Any suggestions?

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    In the report LOAD event, then set your value:

    LblMyLabel.visible= gvPrevVal="bob"

  3. #3
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    You the man! Never would have guessed it.
    How does one learn such code? Is there a resource you recommend?

    Thanks so much

  4. #4
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    That worked fine when I had the report open with acViewReport but not acViewNormal ???

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    alternative event to try is the onFormat event for the section the label is in.

    Or perhaps the gvPrevVal variable is not populated with 'bob'. Depends how you are populating it

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

Similar Threads

  1. Replies: 6
    Last Post: 10-10-2017, 03:01 AM
  2. Replies: 17
    Last Post: 08-03-2017, 06:08 PM
  3. Make Report Label Visible (or not)
    By libraccess in forum Reports
    Replies: 5
    Last Post: 11-02-2013, 07:50 PM
  4. textBox Value making label visible
    By barkly in forum Forms
    Replies: 5
    Last Post: 07-24-2013, 07:05 PM
  5. Textbox/label Visible
    By prawln in forum Programming
    Replies: 6
    Last Post: 05-20-2011, 01:57 PM

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