G
Guest
I have a command button on a form that I am using to open a report showing
items to be despatched on a job. I have the following code on the click event
Private Sub btnDespatchList_Click()
Dim strWhere As String
strWhere = "qryDespatchList.tblShopJob.JobNo =" & "'" & Me.JobNo & "'"
'open despatch report for current order
DoCmd.OpenReport "rptDespatch", acViewPreview, , strWhere
End Sub
The report worked fine until I added the following to the nodata event on
the report
Private Sub Report_NoData(Cancel As Integer)
'Give message that no items are ordered for this job yet
MsgBox "No items are ordered for this" & vbCr _
& "Job currently", vbInformation
Cancel = True
End Sub
If there is no data present the message box appears and then a debug message
come up saying openreport action was cancelled and then goes to the Private
Sub btnDespatchList_Click() event - anyone tell me how to stop this please -
I have used this before and it worked ok
items to be despatched on a job. I have the following code on the click event
Private Sub btnDespatchList_Click()
Dim strWhere As String
strWhere = "qryDespatchList.tblShopJob.JobNo =" & "'" & Me.JobNo & "'"
'open despatch report for current order
DoCmd.OpenReport "rptDespatch", acViewPreview, , strWhere
End Sub
The report worked fine until I added the following to the nodata event on
the report
Private Sub Report_NoData(Cancel As Integer)
'Give message that no items are ordered for this job yet
MsgBox "No items are ordered for this" & vbCr _
& "Job currently", vbInformation
Cancel = True
End Sub
If there is no data present the message box appears and then a debug message
come up saying openreport action was cancelled and then goes to the Private
Sub btnDespatchList_Click() event - anyone tell me how to stop this please -
I have used this before and it worked ok