Question You are subscribed to this thread subforms GotFocus ev

  • Thread starter Thread starter Cyberwolf
  • Start date Start date
C

Cyberwolf

I have a form that has a subform that contains a subform. On this 2nd subform
I have a control that has a GotFocus event. When I open the main form the
GotFocus event fires. Here is the code on the GotFocus event.


Private Sub ReasonID_GotFocus()
Dim intResp As Integer
On Error GoTo ReasonID_GotFocus_Error

stLinkCriteria = "[ReasonCodeID]=" & Me.ReasonCodeID
If Me.ReasonID = 1 Then
intResp = MsgBox("Would you like to view the RPP Cause records?",
vbYesNoCancel, "Releated RPP Cause Records available!")

If intResp = vbYes Then
DoCmd.OpenForm "frm_RPPCauseInfo", acNormal, , stLinkCriteria,
acFormReadOnly, acDialog
End If
End If

On Error GoTo 0
Exit Sub

ReasonID_GotFocus_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
ReasonID_GotFocus of VBA Document Form_frm_ReasonCodes_subform"
End Sub
 
I have a form that has a subform that contains a subform. On this 2nd subform
I have a control that has a GotFocus event. When I open the main form the
GotFocus event fires. Here is the code on the GotFocus event.

You've made a statement. As best as I can tell you have not asked a question.

Do you not want the event to fire? Do you want something else to happen when
it does?
 
Sorry,

Actually I figured this out. My questions was supposed to be, why is the
gotfocus event firing on the subform when the main form opens. I did some
more research and found that the gotfocus event fires when on a subform when
the form is opened because it loads all of the records for the main forms
record.
 
Back
Top