Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sub form text field activation

Status
Not open for further replies.

hrg

Programmer
Jan 8, 2009
46
US
Hi

I have a database where i have a form and a sub form within it. It works by the user entering data in the form. The subform is activated by changing data in the last field in the FORM (onChange Enable subform). When i have finished entering data into the sub form i have a button which when i click it is supposed to go back to the first text field on the FORM. I have tried using the gotocontrol method but do not know if it is the right one to use.

The code.

DoCmd.GoToControl TxtBatchNo (also have tried using brackets)
SUBFORMNAME.Enabled = False

The error that comes up is "The action or method requires a Control Name argument"

So to sum up.

What i want (if anybody could help) is when clicking the button it disables the SUBFORM and goes back to the first text field.

Thank for the help.
 

Your GoToControl command searches for the control in the Sub Form.

Try the following

Forms!YourMainFormName!YourControlName.SetFocus

Hope it helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top