Gary_Mc_Mahon
Board Regular
- Joined
- Apr 30, 2003
- Messages
- 87
Hi,
I'm trying to run a validation event on exit of a control. I've got 95% of the way there, just need a pointer on the finishing touches. I want the cursor to be in the actual field after the event. I cant seem to get the focus right. Here's what I have so far.
Private Sub Susp_Date_Time_triggered_Exit(Cancel As Integer)
'Validation of date entry
If Forms!Frm_Account_Screen![Susp Date/Time triggered] < Forms!Frm_Account_Screen![Date/Time Submitted] Or Forms!Frm_Account_Screen![Susp Date/Time triggered] < Forms!Frm_Account_Screen![Date Received] Then
MsgBox "Invalid date entry, please re enter date.", vbCritical, "Invalid Data"
Forms!Frm_Account_Screen![Susp Date/Time triggered] = ""
Screen.ActiveControl.SetFocus
Else
End If
End Sub
I'm stuck on screen.activecontrol.setfocus, any help??
Cheers,
Gary
I'm trying to run a validation event on exit of a control. I've got 95% of the way there, just need a pointer on the finishing touches. I want the cursor to be in the actual field after the event. I cant seem to get the focus right. Here's what I have so far.
Private Sub Susp_Date_Time_triggered_Exit(Cancel As Integer)
'Validation of date entry
If Forms!Frm_Account_Screen![Susp Date/Time triggered] < Forms!Frm_Account_Screen![Date/Time Submitted] Or Forms!Frm_Account_Screen![Susp Date/Time triggered] < Forms!Frm_Account_Screen![Date Received] Then
MsgBox "Invalid date entry, please re enter date.", vbCritical, "Invalid Data"
Forms!Frm_Account_Screen![Susp Date/Time triggered] = ""
Screen.ActiveControl.SetFocus
Else
End If
End Sub
I'm stuck on screen.activecontrol.setfocus, any help??
Cheers,
Gary