Tab to subform will not work when adding new record

  • Thread starter Thread starter AimeeK via AccessMonster.com
  • Start date Start date
A

AimeeK via AccessMonster.com

Hello, I have a subform embedded in a main form, and I would like the tab
order to go from a check box option group to this subform and then back out
to the main form. This works great when I access an existing record via the
form(s)...however, when I go to add a new record, I get the Error 2110,
"Cannot move the focus to object..."

This is the code I am using below, which isn't anything complicated:

Private Sub optChkCorporLocal_Exit(Cancel As Integer)
Me.subfrmCustNmbr.SetFocus
End Sub

Why would this code work only when tabbing through the form when it's already
filled in? Can anyone help? Thanks.
 
Try forcing the record in the main form to save before setting focus to your
subform.

Add this line above your existing one:
If Me.Dirty Then Me.Dirty = False
 

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

Back
Top