Want only a single record in a subform

G

Guest

In the subform, when I complete entering all of the fields in the 1st
record/row, the second record/row automatially appears. I want the
capability to enter field values in a single record/row and then the tab
should leave the subform and return to the main form. Currently, the tab
moves to the first field in record/row 2. (I will not be entering data in
record/row 2.) Any ideas?
 
V

Van T. Dinh

Try adding an unbound TextBox as the last Control in he Tab Order in the
Subform and use the GotFocus Event of this TextBox to run code to go back to
the Main Form.

HTH
Van T. Dinh
MVP (Access)
 
J

John Vinson

In the subform, when I complete entering all of the fields in the 1st
record/row, the second record/row automatially appears. I want the
capability to enter field values in a single record/row and then the tab
should leave the subform and return to the main form. Currently, the tab
moves to the first field in record/row 2. (I will not be entering data in
record/row 2.) Any ideas?

One way to do this is to put a textbox LAST in the tab order on the
subform; it should be unbound, but it must be visible and enabled for
the code to work. You can make its height and width zero to keep the
user from mouseclicking into it.

In this textbox's GotFocus event put code like

Private Sub txtRelay_GotFocus
Parent!txtNextControl.SetFocus
End Sub

John W. Vinson[MVP]
 
P

pfd

¹ã·ºµÄ
Van T. Dinh said:
Try adding an unbound TextBox as the last Control in he Tab Order in the
Subform and use the GotFocus Event of this TextBox to run code to go back to
the Main Form.

HTH
Van T. Dinh
MVP (Access)
 

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