Results 1 to 2 of 2
  1. #1
    weasel7711 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    25

    Report load events - OnFormat???

    Goal:


    I have a field which holds multiple values (initials of Employees assigned to a specific item). This is displayed on a report as a list box. So it will have column of checkboxes, either checked or unchecked, showing who is assigned to that particular item. The report is grouped into different instances of these items.
    What I want to do is for each instance of an item, display a textbox with a string displaying the Initials of employees assigned to that item, not all employees. So I wrote this code in a Format event for that grouping:

    Code:
        '***DEBUG
        MsgBox ("TEST 123 for RMA: " & txtRMA.Value)
        '***DEBUG
        
        Dim varItem As Variant
        Dim strInitials As String
        Dim lngLen As Long
        With lstEmplAssigned
            For Each varItem In .ItemsSelected
                If Not IsNull(varItem) Then
                    'build a string containing the initials, separated by commas
                    strInitials = strInitials & .ItemData(varItem) & ", "
                End If
            Next
        End With
        
        'Remove trailing comma.
        lngLen = Len(strInitials) - 2
        strInitials = Left$(strInitials, lngLen)
        
        'Set the textbox to show the initials
        txtEmplAssigned.Value = strInitials
    My problem is, nothing is happening, not even the message boxes. Where am I going wrong?

  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
    21,856
    If you're opening the report in the new Report view, the format events do not fire. They only fire in Preview and Print.
    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. Different Events
    By jo15765 in forum Programming
    Replies: 2
    Last Post: 12-07-2010, 12:45 PM
  2. Events Confusion?
    By homerj56 in forum Programming
    Replies: 5
    Last Post: 10-27-2010, 01:45 PM
  3. Form_Load Events
    By TheDeceived in forum Programming
    Replies: 1
    Last Post: 09-20-2010, 12:19 PM
  4. Load Record from report in form
    By rdirosato in forum Reports
    Replies: 13
    Last Post: 03-08-2010, 10:35 PM
  5. Events Report, please help!
    By Suzan in forum Reports
    Replies: 3
    Last Post: 04-19-2006, 01:11 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