no data

kingsgambit

Registered User.
Local time
Today, 09:03
Joined
May 27, 2001
Messages
134
1..If there is no data for my report, my msgbox will come "no record found" the next command I put in was Canel = false.
My msgbox comes up ok put when you press OK access produces another msgbox saying event cancelled. I have tried putting the code
I am having problems with the command
DoCmd.SetWarnings False. but access still shows the cancel event box. Where should i put the Docmd command?
2.. When the user founds the record they want on my search form and clicks on the print preview if there is nodata it does the above, but my search form disappearing before the msgbox comes up and then reappears after you press ok, is there a way to keep my search form visible and just have the msgbox appear on top if there is nodata for the report
 
Option Compare Database
Option Explicit

Const ConErrRptCanceled = 2501

Private Sub Preview_Click()
' Preview report.
Dim strDocName As String

On Error GoTo Err_Preview_Click

strDocName = "MyReport"
DoCmd.OpenReport strDocName, acViewPreview


Exit_Preview_Click:
Exit Sub

Err_Preview_Click:
If Err = ConErrRptCanceled Then
Resume Exit_Preview_Click
Else
MsgBox Err.Description
Resume Exit_Preview_Click
End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom