In that case, Graham gave you the way to go, we just need to back it up to the control's
name. Using the .Controls("name") method will allow you to concatenate together a name.
For i = 1 To 10
With forms!frmname
.Controls("ctrlnm" & i).visible = true
.Controls("ctrlnm" & i).enabled= true
.Controls("ctrlnm" & i).locked= true
.Controls("ctrlnm" & i).backcolor= 124
End With
Next i
--
Wayne Morgan
"HB" <fr*****@telus.net> wrote in message news:WWClb.1198$SJ1.524@edtnps84...
OOPs
I probably didn't explain my question good enough
I eventually want to use an array with string values of the name & the value
in a for each statement so I need to be able to have the property in string
form ie form!frmname!ctrlname(propstring)
Thanks Morgan & all
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:3O******************@newssvr16.news.prodigy.c om... You're close.
With forms!frmname!ctrlnm
.visible = true
.enabled= true
.locked= true
.backcolor= 124
End With
--
Wayne Morgan
"HB" <fr*****@telus.net> wrote in message
news:nFClb.994$SJ1.719@edtnps84... Can I refer to a controls property using a string much like I can a
Control.
I want to simplify the following code:
forms!frmname!ctrlnm.visible = true
forms!frmname!ctrlnm.enabled= true
forms!frmname!ctrlnm.locked= true
forms!frmname!ctrlnm.backcolor= 124
etc
I tried:
with forms!frmname!ctrlnm
.("visible") = true
etc
but it doesn't work - Is there a collection name I should be using or is
there a better way
Thjanks in advance