![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am almost at the end of creating one of my first partially successful database, however i have found an error upon it. I have created a button on the switchboard which will open up one of my form's in a read-only format, this is so the user can search through the clients' currently in the database without the risk of deleting / editing them. The problem is that if the database is empty it comes up with a debug error reading, "you can't go to the specified record". I would like to be able to write some validation code that will bring up a message box informing the user that the database is empty, and then close the form. If anybody can help me then i would be very greatful Cheers, Rich |
#3
| |||
| |||
|
|
Cassyman (AT) hotmail (DOT) com (Richard) wrote in message news:<8bf3cbf6.0404270849.d3861d0 (AT) posting (DOT) google.com>... I am almost at the end of creating one of my first partially successful database, however i have found an error upon it. I have created a button on the switchboard which will open up one of my form's in a read-only format, this is so the user can search through the clients' currently in the database without the risk of deleting / editing them. The problem is that if the database is empty it comes up with a debug error reading, "you can't go to the specified record". I would like to be able to write some validation code that will bring up a message box informing the user that the database is empty, and then close the form. If anybody can help me then i would be very greatful Cheers, Rich Hello Rich, Perhaps what you need to do is put a bit of code behind the button on your switchboard. Example: 'This checks the record source for your form and see's if there is any data, if so, the form will open, if not, a message will display. Dim intValue as Integer intValue = DCount("[FieldName]","QueryName") If intValue = 0 then MsgBox "Sorry, no data to view!", vbCritical, "No Data" Else DoCmd.OpenForm "frmName" End if Regards, Ray |
![]() |
| Thread Tools | |
| Display Modes | |
| |