Setting SetFocus to Main Form causes Subform to be locked

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
 
D

Dirk Goldgar

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
 

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