Custardptt
Technical User
Hi All,
Is there an easy way to detect if a control exists in an access form programmatically?
I have code that attempts to set the value of a checkbox (having retrieved the name of the checkbox from a lookup table). Problem is the lookup up table may contain the names of controls that are not on my form.
The code I’m using to set the object values is (this is part of a loop):-
Set myObject = Me.Controls(myRST("DControlName"))
myObject = myRST("DControlValue")
I want to detect if the control exists before attempting to set its value.
Any Thoughts
Many Thanks
Pete
Is there an easy way to detect if a control exists in an access form programmatically?
I have code that attempts to set the value of a checkbox (having retrieved the name of the checkbox from a lookup table). Problem is the lookup up table may contain the names of controls that are not on my form.
The code I’m using to set the object values is (this is part of a loop):-
Set myObject = Me.Controls(myRST("DControlName"))
myObject = myRST("DControlValue")
I want to detect if the control exists before attempting to set its value.
Any Thoughts
Many Thanks
Pete