referencing a control

F

Fay Yocum

I have main form frmEducation, on that is a subfrmLearners.
On subfrmLearners that are two other subforms subfrmTelephones and
subfrmAddresses.
I want to tab from subfrmTelephones to subfrmAddresses the txtTelephoneTypes
control

I used the advise given last week and got everything to work when I was
dealing with just the subfrmLearners and it's two subforms.

As John Vinson suggested I put a hidden text box on the subfrmAddresses and
put the following into the Got Focus event of that textbox

Private Sub txtHidden_GotFocus()
Forms.frmLearners.subfrmTelephone.SetFocus
End Sub

But when I put the frmEducation into the mix it doesn't work.

How do I properly include the frmEducation into the line above.

Thank you.

Fay
 
F

Fay Yocum

It fails at the

Me.Parent.SetFocus
line. I did try Me!Parent.SetFocus and that didn't work either.

Thank you.

Fay
 
A

Allen Browne

Try something like this:

Private Sub txtHidden_GotFocus()
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
Me.Parent.SetFocus
With Me.Parent.subfrmAddress.Form
.SetFocus
.txtTelephoneTypes.SetFocus
End With
End Sub
 
A

Allen Browne

You can try dropping that line out, or replace it with:
Forms!frmEducation!subfrmAddresses.SetFocus
 

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