Mar 3 2005, 01:49 PM
I found the code to cancel the open and it works great. However, I'm calling the form from another form and once you close the message box about the no records, the Access default msgbox is coming up about the openform event canceled. I need to stop that. I've tried turning off the warnings on both forms. Please help. Thanks.
Mar 3 2005, 01:59 PM
I would use code like this in the On Click event of the button to open the form:
If DCount("*","tblNameOrQryName") = 0 Then
MsgBox "There are no records to display in the form you want to open."
Replace the 'tblNameOrQryName' with the name of the table or query the form you want to open is based on.
Mar 3 2005, 02:08 PM
Works great!! Thanks
Mar 3 2005, 02:13 PM
You are welcome and continued success with your project...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here