Here is what I have found you said you wanted a msg box that says error you need to close report first well here are 2 different ways you can make a great msg box:
1.This one is more less simple gives a statement and a yes or no feature
Code:
If MsgBox("This is What the MSGBOX will say!!!", vbQuestion + vbYesNo, "This is What you want it to do") = vbYes Then
DoCmd.RunCommand 'Make Sure you run whatever Command you chose to do
End If
2.More advanced that has a 3 button layout same concept.
Code:
On Error GoTo Err_bSave_Click
Me.tbHidden.SetFocus
If IsNull(tbFirstName) Or IsNull(tbLastName) Then
Beep
MsgBox "All required fields must be completed before you can save a record.", vbCritical, "Invalid Save"
Exit Sub
End If
Beep
Select Case MsgBox("Do you want to save your changes to the current record?" & vbCrLf & vbLf & " Yes: Saves Changes" & vbCrLf & " No: Does NOT Save Changes" & vbCrLf & " Cancel: Reset (Undo) Changes" & vbCrLf, vbYesNoCancel + vbQuestion, "Save Current Record?")
Case vbYes: 'Save the changes
DoCmd.RunCommand acCmdSaveRecord
Case vbNo: 'Do not save or undo
'Do nothing
Case vbCancel: 'Undo the changes
DoCmd.RunCommand acCmdUndo
Case Else: 'Default case to trap any errors
'Do nothing
End Select
Exit_bSave_Click:
Exit Sub
Err_bSave_Click:
If Err = 2046 Then 'The command or action Undo is not available now
Exit Sub
Else
MsgBox Err.Number & " - " & Err.Description
Resume Exit_bSave_Click
End If