M
Maverick
I've figured out what's happening with my form, but have no idea why or how
to fix it. On my main form, when I create a new record, as soon as I begin to
type (in a textbox named EventName), an event in a subform triggers. There is
no event on the control (EventName) and the event in the subform is an OnExit
event for a combobox (cboBudgetCode). I just don't get it.
I gutted the form of code except for the code on the subform just in case
there were any conflicts. The event still triggered incorrectly.
The issue does not exist on existing records or on a new record that has had
data entered on it. This problem only occurs when a new record is created and
text is typed in the default control (EventName) where the cursor starts when
the new record is created.
The code that triggers is shown below and is used to make it so that I can
tab through the form and subform without having to use the mouse. Without the
code, I would get stuck in an endless loop (while tabbing) once I enter a
subform.
------------------------------------------------------------------------------------------------
Private Sub cboBudgetCode_Exit(Cancel As Integer)
On Error Resume Next
If IsNull(Me.cboBudgetCode) Then
Me.Parent.sfrmTimeSpent.SetFocus
Forms!frmCaseDetails.sfrmTimeSpent.Form!cboTimeSpentDate.SetFocus
End If
End Sub
--
HTH
Don''''t forget to rate the post if it was helpful!
Please reply to newsgroup only, so that others may benefit as well.
to fix it. On my main form, when I create a new record, as soon as I begin to
type (in a textbox named EventName), an event in a subform triggers. There is
no event on the control (EventName) and the event in the subform is an OnExit
event for a combobox (cboBudgetCode). I just don't get it.
I gutted the form of code except for the code on the subform just in case
there were any conflicts. The event still triggered incorrectly.
The issue does not exist on existing records or on a new record that has had
data entered on it. This problem only occurs when a new record is created and
text is typed in the default control (EventName) where the cursor starts when
the new record is created.
The code that triggers is shown below and is used to make it so that I can
tab through the form and subform without having to use the mouse. Without the
code, I would get stuck in an endless loop (while tabbing) once I enter a
subform.
------------------------------------------------------------------------------------------------
Private Sub cboBudgetCode_Exit(Cancel As Integer)
On Error Resume Next
If IsNull(Me.cboBudgetCode) Then
Me.Parent.sfrmTimeSpent.SetFocus
Forms!frmCaseDetails.sfrmTimeSpent.Form!cboTimeSpentDate.SetFocus
End If
End Sub
--
HTH
Don''''t forget to rate the post if it was helpful!
Please reply to newsgroup only, so that others may benefit as well.