Okay, I think this is working now. What I've done is this...
In the code behind the button that triggers the report, I've added error handling code to trap error 2501.
Private Sub cmdGrowthChart2to20_Click()
On Error GoTo errHandler
DoCmd.RunCommand acCmdSaveRecord
If...
Nice try, AtlasAF. But the code still trips up on DoCmd.Close. I'm afraid I don't understand what "processing" the error message is referring to. Could it be because the DoCmd.Close is enclosed in an If statement and control has not yet been passed to End If?
How would I use the NoData event when the recordset is generated in code, rather than by a report query?
Thnx
Lex
IE:
Dim db As Database
Set db = CurrentDb()
Dim StrSQL As String
StrSQL = ("SELECT TOP 9 tblPatients.PatientID, tblPatients.PatientFirstName, tblPatients.PatientLastName...
Well, you'd think this would be easy, but I'm having great difficulty with it. All I want to do is close a report if the recordset is empty. The recordset is built in the report using code. If there are no records in the recordset, control is passed to a MsgBox, like so...
If intPtVisits = 0...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.