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!

How to disable text field controls in subform

Status
Not open for further replies.

vangx222

Technical User
Jun 6, 2007
36
0
0
US
Hi. I have a main form and a sub form.

In my mainfrm I have a text field that is REQUIRED before I can enter any data into the subfrm.

Can anyone help me with this code and how I would relate the two? I know how to do it when all the controls (text fields) are on the same form, but when it's a sub form and a main form then I don't know how to do it anymore.

Help please?

This is what I used for controls that are within the same form.

I tried this
Code:
Me!subfrm.Form!ControlName.Enabled
and placed this on the On Load of the mainfrm and After Update of the control in the mainfrm, but it didn't work.

When you are using this syntax:
Code:
Me![COLOR=#ff0000]subfrm[/color].Form![COLOR=#ff0000]ControlName[/color].Enabled
what does subfrm and ControlName refer too?

is subfrm the name of the control in the SUBFORM or MAINFORM and same question for ControlName?
 
PHV, I looked at the information on that link and it didn't help me much. Someone also suggested this link,


and I'ved tried these syntax as wells and it's not successful either.
It works if I'm in the SUB form and want to disable a field in the MAIN from, but it does NOT work vice versa, MAIN form to SUB form. The message I receive is: "You can't disable a control while it has focus."

..but I can't seem to find where or what the focus is.

Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top