G
Guest
Ken Snell's instructions to Andy in 'SetFocus in a subform' make sense, but I
am having trouble implementing them. My form has a subform placeholder
subDetail which is populated based upon a dialog box selection. My code
successfully populates the placeholder when intDetailType = 1 (only option
tested). It encouters an error from the .SetFocus instruction, "Run-time
error '2210': Microsoft Office Access can't move the focus to the control
subDetail." I can tab to or click on the subform control, but that is
inelegant (and inefficient for the user). When I reset the code and rerun
the dialog box, it sets the focus correctly. Please help!
With subDetail
Select Case intDetailType
Case 1
.SourceObject = "fsubFlight_entry"
.SetFocus
!txtConfirmation.SetFocus
Case 2
.SourceObject = "fsubRCarHotel"
Case Else
MsgBox "Not defined"
End Select
.Visible = True
End With
am having trouble implementing them. My form has a subform placeholder
subDetail which is populated based upon a dialog box selection. My code
successfully populates the placeholder when intDetailType = 1 (only option
tested). It encouters an error from the .SetFocus instruction, "Run-time
error '2210': Microsoft Office Access can't move the focus to the control
subDetail." I can tab to or click on the subform control, but that is
inelegant (and inefficient for the user). When I reset the code and rerun
the dialog box, it sets the focus correctly. Please help!
With subDetail
Select Case intDetailType
Case 1
.SourceObject = "fsubFlight_entry"
.SetFocus
!txtConfirmation.SetFocus
Case 2
.SourceObject = "fsubRCarHotel"
Case Else
MsgBox "Not defined"
End Select
.Visible = True
End With