Boolean variable not holding state
- From: Jordan C. Schroeder <JordanCSchroeder@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 May 2008 13:25:05 -0700
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
.
- Follow-Ups:
- Re: Boolean variable not holding state
- From: Graham Mandeno
- Re: Boolean variable not holding state
- From: Douglas J. Steele
- Re: Boolean variable not holding state
- Prev by Date: Delete records with VBA
- Next by Date: Combobox Afterupdate Event setting text box value
- Previous by thread: Delete records with VBA
- Next by thread: Re: Boolean variable not holding state
- Index(es):
Relevant Pages
|