I use the following code to close a form and open a selected report:
*** Start of Code ***
Application.Echo False, ""
DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.OpenQuery "qryLevyBilledHoldDel"
DoCmd.OpenQuery "qryUnpaidLevy"
DoCmd.OpenQuery "qryUnpaidWaiver"
DoCmd.OpenReport "rptUnpaidsByEmployee", acViewPreview
DoCmd.Maximize
DoCmd.Close acForm, "frmDailyLogOptions"
Application.Echo True
DoCmd.Hourglass False
***End of Code ***
On no data, I have found several ways to stop the process and give a message that there is no data. I have seen different ways of error handling. They are not working. Here is what I am trying to get to. If there are no records, give the no data message, stop the routine and return to my selection form frmDailyLogOptions.
Thank you.
*** Start of Code ***
Application.Echo False, ""
DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.OpenQuery "qryLevyBilledHoldDel"
DoCmd.OpenQuery "qryUnpaidLevy"
DoCmd.OpenQuery "qryUnpaidWaiver"
DoCmd.OpenReport "rptUnpaidsByEmployee", acViewPreview
DoCmd.Maximize
DoCmd.Close acForm, "frmDailyLogOptions"
Application.Echo True
DoCmd.Hourglass False
***End of Code ***
On no data, I have found several ways to stop the process and give a message that there is no data. I have seen different ways of error handling. They are not working. Here is what I am trying to get to. If there are no records, give the no data message, stop the routine and return to my selection form frmDailyLogOptions.
Thank you.