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

Disabling all subform controls 1

Status
Not open for further replies.

RoyVidar

Instructor
Jun 16, 2000
6,606
NO
Hi!

Given a criteria on my main form, I want to disable all controls on my subform.

I do that now bo looping thru the controls (For Each...) and it works fine except for one thing. One of the subform controls has focus, even if the focus is on the main form. So it produces an error (can't disable a control that has focus).

I've "solved";-) it by adding another control to the subform and give it the focus, but isn't there a more elegant way?

Thanx, Roy-Vidar
 
How about this:
Your subform is a control on the mainform so:

Me![NameOfSomeOtherControl].Setfocus
Me![NameOfSubFormAsSeenByTheMainForm].Locked = True

Give it a try!
Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top