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

While disabling form fields getting a "Runtime error 2164"

Status
Not open for further replies.

gsdcrazy

Programmer
Sep 2, 2002
31
US
Gurus,

This is probably a rockie question, but, since I am a rockie, I don't feel bad about it at all.

I have a form with a subform. When the form record equals a certain status, I want some of the fields in the form and all the fields in the subform to be disabled (.enable = false). Disabling the fields in the form is no problem since I have a field to set as my focus while disabling the other fields. When I try to issue the "Forms![Report of Offerings]!DesignatedOfferings.Enabled = False" command for the subform fields, I get Runtime Error of 2164 "You can't disable a control while it has focus." There is no control that I can focus on in the subform to disable the other controls since I want to disable all of them.

Any ideas on what I should really be doing? When I go to the next status, all controls/fields on the form and subform will need to be disabled. The user is no longer permitted to update the record at all.

Your time, patience, and help is greatly appreciated.

Thanks,
gsdcrazy
 
One trick you can use is to include a command button on each form that has its 'Transparent' property set to 'Yes' (not its 'Visible' property).

Then you can set the focus on the transparent button before disabling the other controls. VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top