VBA coding question (1 Viewer)

Bechert

Registered User.
Local time
Today, 19:08
Joined
Apr 11, 2003
Messages
59
Hello all,
I have a form for physical therapists to identify a patient's pain location(s) using option button controls that overlay an outline of a body part (leg, arm, etc.). The associated report needs to display only the controls that are True.
Each of the controls starts with "Pain" (Pain1, Pain2, etc.).
I would prefer to not have to hardcode logic for each control name (there could be 40 or more) to check the value of the control to make it visible or not.

I plan to have a loop go through all the controls that start with "pain" and append a digit to make the control name (for example, "Pain" + x) and then check for True/False and set the visible property.

I tried using the Left function to locate "pain" in the cntl collection but recieved a type mismatch.
Also, what is the format for appending 'x' to "Pain" to create the control name?

Thanks,
bill
 

Users who are viewing this thread

Top Bottom