mloucel
Member
- Local time
- Today, 12:36
- Joined
- Aug 5, 2020
- Messages
- 309
Hello ALL
I have gone through several threads about this issue, and still I can't get it right..
I have a form that requires if the user enter today's date or any other date in ReferDate then the next field "AuthDateEntered" must be > to ReferDate and move to a field XXXX
I tried this:
but NO MATTER what I do, the dam thing keeps moving to the field XXXX after AuthDateEntered.
I have tried all the different solutions I have found here to keep the focus at AuthDateEntered and the instruction is simply ignored just before the End Sub.
I have stop the Tabs, change the name, using no date picker, using the picker, using a different picker, just simply I am at the end of the rope.
Form IS SINGLE bound to a Query, and the cycle is set to current record.
Any Ideas will be appreciated.
I have gone through several threads about this issue, and still I can't get it right..
I have a form that requires if the user enter today's date or any other date in ReferDate then the next field "AuthDateEntered" must be > to ReferDate and move to a field XXXX
I tried this:
Code:
Private Sub AuthDateEntered_LostFocus()
'Private Sub AuthDateEntered_BeforeUpdate(Cancel As Integer)
If AuthDateEntered < ReferDate Then
Me.AuthDateEntered.BorderColor = vbRed
MsgBox "This date cannot be before the referral date" & _
vbCrLf & _
"Please Correct before continue", vbCritical + vbOKOnly, "Error detected"
DoEvents
'Cancel = True
Me!AuthDateEntered.SetFocus
DoCmd.CancelEvent
Else
Me.AuthDateEntered.BorderColor = RGB(166, 166, 166)
End If
End Sub
but NO MATTER what I do, the dam thing keeps moving to the field XXXX after AuthDateEntered.
I have tried all the different solutions I have found here to keep the focus at AuthDateEntered and the instruction is simply ignored just before the End Sub.
I have stop the Tabs, change the name, using no date picker, using the picker, using a different picker, just simply I am at the end of the rope.
Form IS SINGLE bound to a Query, and the cycle is set to current record.
Any Ideas will be appreciated.