R
rich
Hello,
I am trying to validate a date on a sub-form. If the validation fails, the
date field should be reset to an empty string and the focus set to that date
field so user can re-enter a valid date. Problem is, Access says it cannot
find the sub-form. Code is below with error line indicated by ==>
Private Sub AccessVerifiedDate_AfterUpdate()
If AccessVerified = False Then
MsgBox ("You must first check the Access Verified checkbox before
you can enter a Verified Date."), vbOKOnly
AccessVerifiedDate = ""
End If
Do While (AccessVerifiedDate <= txtEmplStartDate)
If AccessVerifiedDate <= txtEmplStartDate Then
MsgBox ("The Access Verified Date must occur after the
employee's ARF submission date. Please re-enter the date.")
End If
AccessVerifiedDate = ""
==> [Forms]![SfrmEmplApplMapping].AccessVerifiedDate.SetFocus
Loop
End Sub
The error message is:
Run-time error '2450'
.......can't find the form 'SfrmEmplApplMapping' referred to in a macro
expression of Visual Basic code. If refers to the sub-form.
Can anyone tell me what I am doing wrong?
Thanks,
rich
I am trying to validate a date on a sub-form. If the validation fails, the
date field should be reset to an empty string and the focus set to that date
field so user can re-enter a valid date. Problem is, Access says it cannot
find the sub-form. Code is below with error line indicated by ==>
Private Sub AccessVerifiedDate_AfterUpdate()
If AccessVerified = False Then
MsgBox ("You must first check the Access Verified checkbox before
you can enter a Verified Date."), vbOKOnly
AccessVerifiedDate = ""
End If
Do While (AccessVerifiedDate <= txtEmplStartDate)
If AccessVerifiedDate <= txtEmplStartDate Then
MsgBox ("The Access Verified Date must occur after the
employee's ARF submission date. Please re-enter the date.")
End If
AccessVerifiedDate = ""
==> [Forms]![SfrmEmplApplMapping].AccessVerifiedDate.SetFocus
Loop
End Sub
The error message is:
Run-time error '2450'
.......can't find the form 'SfrmEmplApplMapping' referred to in a macro
expression of Visual Basic code. If refers to the sub-form.
Can anyone tell me what I am doing wrong?
Thanks,
rich