J
Jordan C. Schroeder
Hello,
I have a form that calls another sub to validate text boxes. I am having
difficulty with getting my boolean variable to carry back to the original
sub.
Code:
**1st module
Private Sub btnSaveRecord_Click()
On Error GoTo Err_btnSaveRecord_Click
Dim validate As Boolean
validateAccount (validate)
If validate = false then
exit sub
else
docmd.save
end if
end sub
**2nd module
Public Sub validateAccount(validate)
If (Account.Value & vbNullString = vbNullString) Then
MsgBox "Account is required!", vbOKOnly
validate = False
Account.Undo
Else
validate = True
End If
End Sub
I have a form that calls another sub to validate text boxes. I am having
difficulty with getting my boolean variable to carry back to the original
sub.
Code:
**1st module
Private Sub btnSaveRecord_Click()
On Error GoTo Err_btnSaveRecord_Click
Dim validate As Boolean
validateAccount (validate)
If validate = false then
exit sub
else
docmd.save
end if
end sub
**2nd module
Public Sub validateAccount(validate)
If (Account.Value & vbNullString = vbNullString) Then
MsgBox "Account is required!", vbOKOnly
validate = False
Account.Undo
Else
validate = True
End If
End Sub