Command button, must have data to continue?

K

Kerman SPI

I have a command button on my form"Incoming Notesheet". The button opens a
macro. 1st an update query "Insert date Issued" is run, 2nd a report opens
after the update query. I need a way to prevent the report "Summary" from
opening if data has not been entered in the update query (Left blank by
mistake). There must be some code to correct this. Here's my code for the
command button...Thanks...Randy


Private Sub PrintSummary_Click()
On Error GoTo Err_PrintSummary_Click

Dim stDocName As String

stDocName = "Summary and Date Issued Macro"
DoCmd.RunMacro stDocName

Exit_PrintSummary_Click:
Exit Sub

Err_PrintSummary_Click:
MsgBox Err.Description
Resume Exit_PrintSummary_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top