G
Geoff H
Hi
Can anyone help me with a little problem. I wish to access a number of
objects (eg textboxes or check boxes) using a "for Next "loop with a
variable instead of how it is now
cbPart1.Value = ""
txtDesc1.Value = ""
txtLoc1.Value = ""
txtUsed1.Value = ""
txtLeft1.Value = ""
cbPart2.Value = ""
txtDesc2.Value = ""
txtLoc2.Value = ""
txtUsed2.Value = ""
txtLeft2.Value = ""
cbPart3.Value = ""
txtDesc3.Value = ""
txtLoc3.Value = ""
txtUsed3.Value = ""
txtLeft3.Value = ""
I have tried using the following and minor variations
For iCount = 1 to 10
oTemp1 = "cbPart" & (iCount)
oTemp2 = "txtDesc" & (iCount)
oTemp3 = "txtLoc" & (iCount)
oTemp4 = "txtUsed" & (iCount)
oTemp5 = "txtLeft1" & (iCount)
oTemp1.Value = ""
oTemp2.Value = ""
oTemp3.Value = ""
oTemp4.Value = ""
oTemp5.Value = ""
next
May not be the best illustration (I have one instance where I need to
test the status of 83 check boxes)but what I am after is the method or
ability to convert variables to object references as VBA doesnt seem
to support Control Arrays.
Am I flogging a dead horse?
Any help would be well helpfull (Holy Grail)
Can anyone help me with a little problem. I wish to access a number of
objects (eg textboxes or check boxes) using a "for Next "loop with a
variable instead of how it is now
cbPart1.Value = ""
txtDesc1.Value = ""
txtLoc1.Value = ""
txtUsed1.Value = ""
txtLeft1.Value = ""
cbPart2.Value = ""
txtDesc2.Value = ""
txtLoc2.Value = ""
txtUsed2.Value = ""
txtLeft2.Value = ""
cbPart3.Value = ""
txtDesc3.Value = ""
txtLoc3.Value = ""
txtUsed3.Value = ""
txtLeft3.Value = ""
I have tried using the following and minor variations
For iCount = 1 to 10
oTemp1 = "cbPart" & (iCount)
oTemp2 = "txtDesc" & (iCount)
oTemp3 = "txtLoc" & (iCount)
oTemp4 = "txtUsed" & (iCount)
oTemp5 = "txtLeft1" & (iCount)
oTemp1.Value = ""
oTemp2.Value = ""
oTemp3.Value = ""
oTemp4.Value = ""
oTemp5.Value = ""
next
May not be the best illustration (I have one instance where I need to
test the status of 83 check boxes)but what I am after is the method or
ability to convert variables to object references as VBA doesnt seem
to support Control Arrays.
Am I flogging a dead horse?
Any help would be well helpfull (Holy Grail)