I handle the 2501 error in the Report_NoData event but, if there is no data, I don't want this message to appear in the Report_Close event. Should I set a global variable to capture the NoData value or is there a better way?
Response = MsgBox("If you are satisfied with the report" _
& vbCrLf & "click on the [OK] button to update the" _
& vbCrLf & "underlying table with today's report date." _
& vbCrLf & "Otherwise, click on the [Cancel] button.", vbOKCancel, _
"RPP Tracking System")
If Response = vbOK Then
' run query to update the ReportDate field where it is null
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryMilTxnStatusCode-DateReported"
Else
' do nothing
End If
Response = MsgBox("If you are satisfied with the report" _
& vbCrLf & "click on the [OK] button to update the" _
& vbCrLf & "underlying table with today's report date." _
& vbCrLf & "Otherwise, click on the [Cancel] button.", vbOKCancel, _
"RPP Tracking System")
If Response = vbOK Then
' run query to update the ReportDate field where it is null
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryMilTxnStatusCode-DateReported"
Else
' do nothing
End If