Results 1 to 5 of 5
  1. #1
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43

    Code For Msgbox On A Report To Show The Difference Between To Fields., Access 2010

    Hey All, I have a manifest report and on the report I have a field that gives the total count of records and another field that gives total value of checkboxes on report. I have code on the report load event that has a msgbox that states the carton is complete but I want another msgbox to state how many records are not manifested in the event that the two fields don't equal each other. Here is what I have so far for the code. Thanks!
    Code:
    Private Sub Report_Load()
    If Me.AccessTotalsMANIFESTED = Me.AccessTotalsCLAIM_NUMBER Then
    MsgBox "Every folder in carton has been manifested."
    Else
    MsgBox
    End If
    End Sub


  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Msgbox is useless for reports.

    You can put a message IN the report, txtMsg.visible = AccessTotalsMANIFESTED = AccessTotalsCLAIM_NUMBER

  3. #3
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Okay, so can I still have a message popup that your way showing how many records are not manifested?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    What happens when you run the code?

    Why do you have the Else part?
    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
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Oh, sorry I have solved the problem with this code.
    Code:
    Private Sub Report_Load()
    If Me.AccessTotalsMANIFESTED = Me.AccessTotalsCLAIM_NUMBER Then
    MsgBox "All records in carton have been manifested and shipped out on or around " & Me.DATE_BOX_WAS_SHIPPED & "."
    Else
    MsgBox "There are " & Me.AccessTotalsCLAIM_NUMBER - Me.AccessTotalsMANIFESTED & " records remaining to be manifested."
    End If
    End Sub

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

Similar Threads

  1. Replies: 1
    Last Post: 09-27-2013, 12:49 PM
  2. Replies: 5
    Last Post: 09-11-2013, 03:42 PM
  3. Replies: 1
    Last Post: 02-25-2013, 03:16 PM
  4. Replies: 3
    Last Post: 11-18-2012, 12:49 PM
  5. show difference of amounts in a report
    By taniuca in forum Reports
    Replies: 0
    Last Post: 08-07-2008, 06:58 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