Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no records- no print 1

Status
Not open for further replies.

kennetha

Programmer
Sep 10, 2003
105
MT
Hi all,

I've created the below code so if no records (in a report) are not found nothing happens.
It doesn't work thou!
Any suggestions

Thanks in advance
Kenneth

Private Sub cmdpicklistregular_Click()
DoCmd.OpenReport "rptPickingList"
If Reports![rptPickingList].RecordsetClone.RecordCount = 0 Then
MsgBox "No records Found. " & Chr(10) & Chr(13) & "Kindly check Picking Numbers. ", , pro
DoCmd.close acForm, "PickingNumbers"
End If
End Sub
 
Try the "on no data" event in the report.
cancel = true
MsgBox "No records Found.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top