I have some code that loops through the controls on a form. If a check box is checked then i want the corresponding text box to be made required.
eg.
blah blah
if cControl.controlType = acCheckBox then
if cControl.value = -1 then
sTextBox = "txt" & Right$(s, Len(s) - 3)
else
goto ignore
end if
else
goto ignore
end if
ignore:
I now have, say, sTextBox = txtMechanical. How can i convert this string value to a control value so I can refer to it like:
if sTextBox.enabled then...
If this does not make sense please let me know. I have spent ages today trying all sorts of things.
Please help,
Nick
eg.
blah blah
if cControl.controlType = acCheckBox then
if cControl.value = -1 then
sTextBox = "txt" & Right$(s, Len(s) - 3)
else
goto ignore
end if
else
goto ignore
end if
ignore:
I now have, say, sTextBox = txtMechanical. How can i convert this string value to a control value so I can refer to it like:
if sTextBox.enabled then...
If this does not make sense please let me know. I have spent ages today trying all sorts of things.
Please help,
Nick