option button value error

  • Thread starter Thread starter zSplash
  • Start date Start date
Z

zSplash

I am trying to create a form to get input. I have a single optionGroup with
2 option buttons in it. There are 3 related textboxes. If opt1.value=true,
then tbx2 and tbx3 are not used; if opt2.value is true, then tbx1 is not
used. The trouble is, when I try to code that, I get an error (#2427 - "You
entered an expression that has no value."). What's up - why does
opt2.value=true generate the error? Here's my code:
If opt2.Value = True Then
tbx2.BackColor = "16777215"
tbx3.BackColor = "16777215"
tbx1.BackColor = "-2147483633"
Else
tbx2.BackColor = "-2147483633"
tbx3.BackColor = "-2147483633"
tbx1 = "16777215"
End If

TIA
 
You're actually looking for the value of the optionGroup, not an individual
selection within the group.

If Me.optionGroup.Value = 1 Then
...
ElseIf Me.optionGroup.Value = 2 Then
...
 
Thanks, Kingston. I don't have an optionGroup -- at least, when I type Me.
I don't get intellisense saying I have one (it does indicate I have opt1 and
opt2). I get an error ("method or data member not found") on .OptionGroup.

(But, I did put the two option buttons in a frame, and only one option
button is selectable at a time -- doesn't that imply an optionGroup??)
 
Yes, it does. I don't know what the exact control name is. I just used
optionGroup because it was in your earlier post. Use the name of the frame
control. Just click once on the frame and see what it's called in the
toolbar or properties window.
Thanks, Kingston. I don't have an optionGroup -- at least, when I type Me.
I don't get intellisense saying I have one (it does indicate I have opt1 and
opt2). I get an error ("method or data member not found") on .OptionGroup.

(But, I did put the two option buttons in a frame, and only one option
button is selectable at a time -- doesn't that imply an optionGroup??)
You're actually looking for the value of the optionGroup, not an
individual
[quoted text clipped - 25 lines]
 
Thanks, Kingston.

kingston via AccessMonster.com said:
Yes, it does. I don't know what the exact control name is. I just used
optionGroup because it was in your earlier post. Use the name of the
frame
control. Just click once on the frame and see what it's called in the
toolbar or properties window.
Thanks, Kingston. I don't have an optionGroup -- at least, when I type
Me.
I don't get intellisense saying I have one (it does indicate I have opt1
and
opt2). I get an error ("method or data member not found") on
.OptionGroup.

(But, I did put the two option buttons in a frame, and only one option
button is selectable at a time -- doesn't that imply an optionGroup??)
You're actually looking for the value of the optionGroup, not an
individual
[quoted text clipped - 25 lines]
 
Thanks, Kingston. Got it, thanks to your help!

kingston via AccessMonster.com said:
Yes, it does. I don't know what the exact control name is. I just used
optionGroup because it was in your earlier post. Use the name of the
frame
control. Just click once on the frame and see what it's called in the
toolbar or properties window.
Thanks, Kingston. I don't have an optionGroup -- at least, when I type
Me.
I don't get intellisense saying I have one (it does indicate I have opt1
and
opt2). I get an error ("method or data member not found") on
.OptionGroup.

(But, I did put the two option buttons in a frame, and only one option
button is selectable at a time -- doesn't that imply an optionGroup??)
You're actually looking for the value of the optionGroup, not an
individual
[quoted text clipped - 25 lines]
 

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

Back
Top