label caption

J

JT

I have a form with 15 Option Button controls. Each control represents an
asset. There are also 15 labels on this form. Each label caption contains
the price for each asset.

When the user pushes a button the macro cycles through the controls to get
the asset. Based on the control, I would like to get the corresponding
amount from the label caption.

For example:

Control.name Label.name

P1_RB01 P1L01
P1_RB02 P1L02
P1_RB03 P1L03

Based on the option button selected, I strip off the last 2 characters and
create a tmp string variable. If the user selects the first item, the string
variable is "P1L" and "01" or "P1L01"

How do I create another variable to get the amount? Both vamount =
tmp.caption or vamount = label (tmp).caption doesn't work.

Any suggestions would be appreciated. Thanks for the help.......
 
D

Dave Peterson

msgbox me.controls(tmp).caption

I have a form with 15 Option Button controls. Each control represents an
asset. There are also 15 labels on this form. Each label caption contains
the price for each asset.

When the user pushes a button the macro cycles through the controls to get
the asset. Based on the control, I would like to get the corresponding
amount from the label caption.

For example:

Control.name Label.name

P1_RB01 P1L01
P1_RB02 P1L02
P1_RB03 P1L03

Based on the option button selected, I strip off the last 2 characters and
create a tmp string variable. If the user selects the first item, the string
variable is "P1L" and "01" or "P1L01"

How do I create another variable to get the amount? Both vamount =
tmp.caption or vamount = label (tmp).caption doesn't work.

Any suggestions would be appreciated. Thanks for the 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