Need some help with passing a label to a subroutine. I have a form with
lots of checkboxes. When the form loads i have a procedure that runs to
lookup values and check the appropriate boxes. If the box is checked I
want the label to look like a hyperlink. Then the user can click on the
label to open a new form that is linked to the checkbox. I had to make
labels that were not attached to the checkboxes. If you click a label
that is attached to a checkbox it toggles the value and I don't want
that. I have code that does this when the user first completes the form
and everything works fine. Now I want to populate the form when it
opens at a later time and that is where the trouble is.
When the FormLoad routine fires a dynamic routine runs to pull the
value for each box.
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then
. . .
This procedure then calls a subroutine that does the work. The problem
I'm having is passing the label to the subroutine. I have some naming
going on so I can use string functions to extract the label name from
the checkbox name. Since I'm doing this it doesn't recognize it as
label control. Does anyone know how I can do this dynamically so I
don't have to have 44 If statements or Case Select statements?
Thanks all
Mike