tabbing between subforms

  • Thread starter Thread starter Speedy
  • Start date Start date
S

Speedy

Hi all,

First time poster long time reader.

My query is how can i tab between subforms. I have a customer page where
data can be entered but this data spans accross several subforms. Is there a
way to tab from the main form to the subforms or does someone have to
navigate there with the mouse? im sure this is a silly question but it has
me stumped so i thought i would ask

Thanks in advance

Daniel
 
Hi Daniel, and welcome.

Here are a couple of options.

1. Shortcut key
==========
A simple one is to use a shortcut key.
Make sure the text box you wish to jump to has an attached label.
Set the caption of the label to something that contains an ampersand, e.g.:
&Address
Now you can hold down the Alt key and press A to jump to that field.

2. Automatic jump
============
Another alternative is to place a text box after the last one on your
subform. When this text box gets focus, it jumps to the next subform.

Private Sub txtJump_GotFocus()
If Me.Dirty Then 'Save this subform first
Me.Dirty = False
End If
'Set focus to the other subform control on the main form.
With Me.Parent![NameOfOtherSubformHere]
.SetFocus
'Set focus to a particular control in the other subform.
.Form![NameOfSomeTextBoxHere].SetFocus
End With
End Sub
 
Back
Top