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

Cant set enabled / locked ?

Status
Not open for further replies.

DahMurf

Programmer
Apr 12, 2003
44
US
(posted on Forms section also)

In a form's onOpen I was setting several fields to enabled = false. I could set most of the fields but a few of them couldn't be set. When typing them in, the autoformat drop down would only show "value" where the others would allow many controls like locked & enabled.
When I try to run it gives me the error
438
Object doesn't support this property or method.

I can set the value on the properties when editing the form but I want to turn this on & off on the fly.

Any ideas what to check? I can't find anything in the field definition that's wrong.
Thanks
 

First of all there is NO WAY that you are setting any FIELDS to Enabled = False

FIELDS do not have an "Enabled" property.

If you are talking about Forms then I assume you mean you are trying to set the CONTROL's Enabled property.

Only some controls have an enabled property.
Those that do are what VB call 'data aware' controls such as Text boxes, combo boxes, list boxes, tick boxes etc.

Labels, Lines, Pagebreaks etc do not have an enabled property and you will get an error if you try to disable it.

Are you sure that the controls you are trying to Disable all fall withing the first set ?



You will also get an error if you try to set Enabled = False to the control that has the focus. This is because the a Disabled control cannot have the focus and MSAccess will not move the focus on to another ontrol if you try to Disable the current one - it throws an error instead.




'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Forgive me for being terminology challenged. I’m self-taught so most times I know what I want to do but don’t always have the right terms for everything. Let me try to explain again with better terminology. (I hope)

I created a data entry form with several text boxes. The text boxes correlate to data in a table. (I think this makes them bound?) I need to force my users to key data into the first text box before doing anything else. It was suggested to me that I could set all of the other text box controls to enabled = false until valid data was typed in the first field. I was able to set enabled = false on most of the text boxes but a few of them would not allow it.

All of the text box properties look the same to me other then location and tab index so I’m stumped. Another user suggested I check to make sure I don’t have duplicate labels. I’ll check that next. I will also make sure that I am not messing with the first text box that has focus. (I don’t believe this is a problem though)

Does anyone have any other thoughts or suggestions?

I’m wondering if maybe I’m taking the wrong approach. I was trying to do this all on one form so as not to confuse my users. They’re very non-technical and I’m having to very thoroughly validate all data.

Thank you & I apologize for the inappropriate manor in which I cross-posted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top