Funkyaccess
Registered User.
- Local time
- Today, 09:03
- Joined
- Oct 8, 2009
- Messages
- 69
Hi,
I want to check my values before they update a record.
this is the private sub on the form
ANd this is the validation function which is part of a standalone module
How do I get around this error message?
I want to check my values before they update a record.
this is the private sub on the form
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
'On Error GoTo err_validations
Dim l_check As Boolean
l_check = validate_SO_record(Me.database_id, Me.data_for)
'If (l_che = False) Then GoTo err_validations
Exit Sub
'err_validations:
MsgBox gblErrorMsg, vbCritical, "Validation Error"
End Sub
ANd this is the validation function which is part of a standalone module
Code:
Function validate_SO_record(database As Integer, data_for As Date) _
As Boolean
If (IsNull(database) = True) Then
gblErrorMsg = "Please select a Database."
validate_SO_record = False
Exit Function
ElseIf (IsNull(data_for) = True) Then
gblErrorMsg = "Please select a Cashbook Date."
validate_SO_record = False
Exit Function
End If
validate_SO_record = True
End Function
How do I get around this error message?