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

object methods/properties not available in VBE

Status
Not open for further replies.

dabruins

Programmer
Mar 9, 2005
102
CA
I apologize if this question is redundant but my searching has not provided any answers. I'm unsure of what to use as search criteria?

I have added an event method to a checkbox control to change the value of control's locked property based upon the value of the checkbox as below.

Private Sub chkEditMode_AfterUpdate()
Dim ctl As Control

For Each ctl In Me.Controls
ctl.Locked = Not Me.chkeditmode.Value
Next ctl

End Sub

When I change the value of the checkbox by clicking on it I get an error noting that the objct does not support this property or method. Even when attempting to call a property or method of "ctl" within the VBE the 'locked' and many other properties do not appear in the dropdown list that usually displays all options.

Does anyone have any idea why this is occurring? I have been doing development inside the VBE for some time and have not experienced this. I'm using Access 2003 on a 2002 mdb.

Thanks.
 
Not all controls are Lock-able.
You have to test the ctl.ControlType property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
My apologies once again!

Not all controls have the same properties hence the generic control object 'ctl' will not have a complete list of properties and methods available on it. The code errored out because it was I didn't check to see what kind of control was being changed. Just plain stupdity on my part.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top