G
Greenface
Guest
Question - How do you do data validation during the BeforeUpdate event? How do you halt the event without getting an error message?
I have tried the following:
If (Me.Control.Value <> "") Then
'Do nothing.
Else
Msgbox "Please enter a value for Control."
Cancel = True
End If
When Cancel = True is executed, I get the following message:
You can't save this record at this time. DatabaseName may have encountered an error while trying to save a record. If you close this object now, the data changes you made will be lost. Do you want to close the database object anyway?
I can't seem to halt or "cancel" the BeforeUpdate event without getting this error message. After hours of looking for this answer, any suggestions would be appreciated.
I have tried the following:
If (Me.Control.Value <> "") Then
'Do nothing.
Else
Msgbox "Please enter a value for Control."
Cancel = True
End If
When Cancel = True is executed, I get the following message:
You can't save this record at this time. DatabaseName may have encountered an error while trying to save a record. If you close this object now, the data changes you made will be lost. Do you want to close the database object anyway?
I can't seem to halt or "cancel" the BeforeUpdate event without getting this error message. After hours of looking for this answer, any suggestions would be appreciated.