Results 1 to 11 of 11
  1. #1
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39

    On Load Event for report


    What have I done wrong? Thanks in advance


    Private Sub Report_Load()

    If IsNull(Me.TagExpDate) Then
    Me.Label28.Visible = True
    Else
    Me.Label28.Visible = False
    End If

    End Sub

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I don't know - what does 'wrong' mean? Do you get an error message? If so, what is the message?

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You only need
    Label28.Visible = Isnull(tagexpdate)

    and you may need it in ONPRINT event

  4. #4
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Sorry -
    forgot to say it (appears) not firing. I have 3 records in the report have no value in the TagExpDate field. I have Label28 in the detail section with caption as "non-expiring" that should display for the 3 records. Thought maybe I screwed up the event procedure or maybe using the wrong event.

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    On load event happens once, don't you want it in the detail event so it fires on each record?

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    OnLoad only fires once, as ranman256 said, and formatting in that event will be based on the state of the first Record displayed. If the first Record dictates that Label28.Visible = True...then that's how it will display for all Records...and vice versa; if the first Record dictates that Label28.Visible = False, then that's how it will display for all Records!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Yes that would certainly cause the problem but where is the detail event? Can't find it.

    Thanks for your patience...

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    As indicated in post #6, you may not be able to accomplish what you want, the way you are going about it. Perhaps building a query that employs an alias would be beneficial. Rather than a label, use a control bound to the alias in your query. SQL in the query can show or hide whatever characters would normally be displayed in your label.

  9. #9
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Found it! (never used it before) and it's working fine in print preview.

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by zburns View Post
    Found it! (never used it before) and it's working fine in print preview.
    Can you share your solution? What code did you use and which event? Did you test the results with multiple records per detail?

  11. #11
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Forgot to say that it will only work in print preview

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

Similar Threads

  1. Replies: 1
    Last Post: 03-29-2014, 07:46 PM
  2. zoom in on report load
    By tweety in forum Reports
    Replies: 8
    Last Post: 04-14-2013, 09:15 AM
  3. Form Load Event
    By shah1419 in forum Forms
    Replies: 5
    Last Post: 01-13-2013, 12:42 PM
  4. load form based on report
    By bigmac in forum Reports
    Replies: 1
    Last Post: 05-01-2012, 09:33 AM
  5. Load Record from report in form
    By rdirosato in forum Reports
    Replies: 13
    Last Post: 03-08-2010, 10:35 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