Form Alignment

P

Pating

I have a form which includes a subform. The subform has 3 tabs. When I
select a different tab, the entire form aligns on the first field in the
subform. I don't know vba....so is there a way to make the form align on the
first field after clicking on one of the subform tabs?
 
A

Arvin Meyer [MVP]

Do you mean setting the focus on the first control of each subform? If so
use the Change event to set the focus:

Private Sub TabCtl20_Change()

Select Case Me.TabCtl20
Case 0
Me.NameOfSubform1.Form.ControlWhatever1.SetFocus
Case 1
Me.NameOfSubform2.Form.ControlWhatever2.SetFocus
Case 2
Me.NameOfSubform2.Form.ControlWhatever3.SetFocus
End Select

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