Event triggering on subform while in main form

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.
 
M

Maverick

There is no BeforeInsert event on the form. Additionally, I had stripped out
all of the code on the form with the exception of the code posted that
resides in the subform. Somehow, the event is triggering inside the subform
with no code on the form itself. There are not timer events either.

Thanks for trying. :)

--

HTH

Don''''t forget to rate the post if it was helpful!

Please reply to newsgroup only, so that others may benefit as well.
 
M

Maverick

Both.

--

HTH

Don''''t forget to rate the post if it was helpful!

Please reply to newsgroup only, so that others may benefit as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top