Setting SetFocus to Main Form causes Subform to be locked

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

From the subform, I SetFocus to the main form. At this point the subform is
locked (cannot enter data). Is there a way to unlock the subform so that
users can enter data (in case they made a mistake and need to go back and
reenter/correct data)?

Scenario is below:

The last textbox in the subform is unbound (is last in the tab order)
This textbox's GotFocus event code is similar to:

Private Sub txtRelay_GotFocus
Parent!txtNextControl.SetFocus
End Sub
 
jsccorps said:
From the subform, I SetFocus to the main form. At this point the
subform is locked (cannot enter data). Is there a way to unlock the
subform so that users can enter data (in case they made a mistake and
need to go back and reenter/correct data)?

Scenario is below:

The last textbox in the subform is unbound (is last in the tab order)
This textbox's GotFocus event code is similar to:

Private Sub txtRelay_GotFocus
Parent!txtNextControl.SetFocus
End Sub

I suspect that what's happening is that txtRelay remains the active
control on the subform, so that whenever the focus goes back to the
subform, it gets sent right back to the main form. Try setting the
focus first to another control on the subform, and only then setting the
focus to the main form. Similar to this:

Private Sub txtRelay_GotFocus
Me!txtSomeOtherControl.SetFocus
Me!Parent!txtNextControl.SetFocus
End Sub
 
Back
Top