How to concatenate a form's control name with another control's va

G

GeorgeAtkins

In 2007. I have a form with a frame containing option buttons. Along side
each is a textbox containing a date. I want the user to select an option
button and use the value returned to select the adjacent date value.
Frame is named FramePeriod
Dates are named Period1, Period2, Period3, etc.

So, I've tried this:
RptPeriod = Me.FramePeriod
Debug.Print Me.Period & RptPeriod
If I pick the third option button, I would expect the code to select the
third date.
I error out with "Method or data member not found", because VBA tries to
resolve "Me.Period" before performing the concatenation, which would provide
a correct name of Me.Period3, for example.

How can I resolve this, short of giving up on option buttons and going with
selecting the actual date control (which I don't want to happen)? THANKS FOR
ANY HELP!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top