By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,591 Members | 650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,591 IT Pros & Developers. It's quick & easy.

dynamically control form objects

P: n/a
If you have say 20 option buttons named
option1, option2,...,option20
and their corresponding labels
label1, label2,....,label20
is there any way you can fill in their label names from a table(20
records) using a For loop....i.e.

For i = 1 to myrecs.recordcount
labelname = "label" & i
[labelname].caption = myrecs!recordValue
myrecs.movenext
Next

Or is the only option to go through each one explicitly?
I have tried declaring the variable "labelName" as a variant and an
object but this doesn't seem to work.
If someone knows a way to get round this, or knows that it is
completely impossible, I would be most grateful.

Thanks in advance.

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Me(labelname).Caption = "xyz"
No dot between Me and parens
Hank Reed

mi********@hotmail.com wrote:
If you have say 20 option buttons named
option1, option2,...,option20
and their corresponding labels
label1, label2,....,label20
is there any way you can fill in their label names from a table(20
records) using a For loop....i.e.

For i = 1 to myrecs.recordcount
labelname = "label" & i
[labelname].caption = myrecs!recordValue
myrecs.movenext
Next

Or is the only option to go through each one explicitly?
I have tried declaring the variable "labelName" as a variant and an
object but this doesn't seem to work.
If someone knows a way to get round this, or knows that it is
completely impossible, I would be most grateful.

Thanks in advance.


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.