teknogeek9
Registered User.
- Local time
- Today, 11:27
- Joined
- Jan 4, 2001
- Messages
- 15
I have encountered a very strange situation which I am wondering if any of you have an insight to.
I have a form for which the first field is a bounded combobox (MOD_ID) must be filled. The value can either be entered by the user or selected from a table.
In my onExit for this field, I have the following code:
******************************************
Private Sub MOD_ID_Exit(Cancel As Integer)
If IsNull(Me.MOD_ID) Then
MsgBox "Please select a module."
Me.SCRIPT_NBR.SetFocus
Me.MOD_ID.SetFocus
End If
End Sub
******************************************
Notice that I have Me.SCRIPT_NBR.SetFocus before Me.MOD_ID.SetFocus. What this does is forced the cursor to go to the next field and then back to the field which must be filled. (Users don't see this happening but us programmers "do"!)
If I don't include Me.SCRIPT_NBR.SetFocus, the cursor does not go back to MOD_ID. I am actually using Me.SCRIPT_NBR.SetFocus to fool the code to go to MOD_ID.
Any ideas?
I have a form for which the first field is a bounded combobox (MOD_ID) must be filled. The value can either be entered by the user or selected from a table.
In my onExit for this field, I have the following code:
******************************************
Private Sub MOD_ID_Exit(Cancel As Integer)
If IsNull(Me.MOD_ID) Then
MsgBox "Please select a module."
Me.SCRIPT_NBR.SetFocus
Me.MOD_ID.SetFocus
End If
End Sub
******************************************
Notice that I have Me.SCRIPT_NBR.SetFocus before Me.MOD_ID.SetFocus. What this does is forced the cursor to go to the next field and then back to the field which must be filled. (Users don't see this happening but us programmers "do"!)
If I don't include Me.SCRIPT_NBR.SetFocus, the cursor does not go back to MOD_ID. I am actually using Me.SCRIPT_NBR.SetFocus to fool the code to go to MOD_ID.
Any ideas?