Disable/Enable controls on a subform

DataMinerHome

Registered User.
Local time
Today, 08:56
Joined
Jan 4, 2010
Messages
57
I need to be able to disable/enable controls on a subform based on various entries on the main form and/or subform. But when I try to reference the "enabled" property, I get error "Object doesn't support this property or method".


For example, using the immediate window, with main form JobLookup and Subform DataEntryMaster:
?forms.joblookup.dataentrymaster!setupstarttime
returns a date, as expected
But
?forms.joblookup.dataentrymaster!setupstarttime.enabled
returns the error shown above

I've also tried various formats like:
forms.joblookup.form.dataentrymaster!setupstarttime.enabled
forms.joblookup.dataentrymaster.controls("setupstartime").enabled
with no help.

How do I do this?
Using Access 2007.

Thanks for any suggestions.
 
Not sure if I understand the questions straight up but try this:

forms![joblookup]![dataentrymaster]!Form.setupstarttime.enabled = False
 
This doesn't work.
forms![joblookup]![dataentrymaster]!Form.setupstarttime.enabled = False gives error "can't find field "form".
forms![joblookup]![dataentrymaster].Form.setupstarttime.enabled = False gives error
"object doesn't support this property or method."
 
Oh, S**T. This was all because I was using the control source (setupstarttime) instead of the control NAME (setupstart). How many times have I been burnt by this in the past?????? You'd think I'd learn.....;-) Works fine as long as you use the correct control name!!!!
 

Users who are viewing this thread

Back
Top Bottom