Checking the value of a radiobutton in Excel VBA

E

Eliezer

I have the following code:

Do Until [ ... ]
repName = wrksheet.Cells(currentInputRow, "A")

'does user want to process commissions for this
user?
If
mainForm.repsNames_frame.allOrSome_frame.someReps_rb.Value
= True Then 'if this button is checked, user only wants
some reps
' do lots of stuff...
End If
Loop

I'm getting the error "Object doesn't support this
property or method" on the line beginning with "IF".
What's the proper way for me to check the value of a
radiobutton, or in other words, why isn't this working?
(As you can see from the current reading of that line, the
readiobutton is enveloped in a frame inside of another
frame.)

Thanks so much,
Eliezer
 
H

Harald Staff

Hi Eliezer

Nested frames or not, the Form itself would be the button's parent in this
case.
mainForm.someReps_rb.Value should do.

HTH. Best wishes Harald
 
E

Eliezer

Harald,

Thanks so much! Perfect!
Eliezer

-----Original Message-----
Hi Eliezer

Nested frames or not, the Form itself would be the button's parent in this
case.
mainForm.someReps_rb.Value should do.

HTH. Best wishes Harald

"Eliezer" <[email protected]> skrev i melding
I have the following code:

Do Until [ ... ]
repName = wrksheet.Cells(currentInputRow, "A")

'does user want to process commissions for this
user?
If
mainForm.repsNames_frame.allOrSome_frame.someReps_rb.Value
= True Then 'if this button is checked, user only wants
some reps
' do lots of stuff...
End If
Loop

I'm getting the error "Object doesn't support this
property or method" on the line beginning with "IF".
What's the proper way for me to check the value of a
radiobutton, or in other words, why isn't this working?
(As you can see from the current reading of that line, the
readiobutton is enveloped in a frame inside of another
frame.)

Thanks so much,
Eliezer
 

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