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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform disable return text

Status
Not open for further replies.

hrg

Programmer
Jan 8, 2009
46
0
0
US
I have a form (frmOrders) within it i have a subform (subfriendorder which is always at the bottom of the main form). The subform is always disabled until you enter a number in a text field in the main form (fromorders). Once i have entered the data it enables a lets the user enter data into the subform(subfriendorder). When i want to leave the form via a button it should go back to the first text field in the main form and also disable the subform (subfriendorder).

I do not know how to return to the first text field and disable the subform using a button. Please could someone help.

I have tried the following


Forms!frmorder!TxtBatchNo.SetFocus

Forms!frmorder.SetFocus("Child58").enable = False

**child58 being the subform in the main form
 
Not Forms!frmorder.SetFocus("Child58").enable = False
But Forms!frmorder!Child58.Form.enabled = False

 
Your syntax is wrong:
Not:
Forms!frmorder.SetFocus("Child58").enable = False

Rather

Forms!frmOrder![Child58].enabled = false

To explicitly write it:

Forms("frmOrder).Controls("Child58").Enabled = False

Either one should work.

Bob
 
Hi! your sintax is wrong!
try this:

[Forms]![frmOrder]![Child58].enabled = false

Skep :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top