Please help, simple radio button code wont work and I cant work out why (1 Viewer)

andyj2k1

New member
Local time
Today, 18:18
Joined
Feb 25, 2007
Messages
3
Hi folks. Ive got a simple bit of code saying..

Dim score As Integer
score = 0

If Option16.Value = 1 Then
score = score + 1
end if

But i keep geting an error message saying "you entered an expression that has no value"

Anyone got any ideas, this is really frustrating me now!
 

Rickster57

Registered User.
Local time
Today, 10:18
Joined
Nov 7, 2005
Messages
431
option

the option value = -1 for true and zero for false.

OOPs, I'm thinking of a checkbox. Sorry about that.
 
Last edited:

unclejoe

Registered User.
Local time
Tomorrow, 01:18
Joined
Dec 27, 2004
Messages
190
Hi,

It should be "Option16.OptionValue".

This control ("Option16.Value") does not work in VBA.

You can set the OptionValue to 1,2,3...etc.

HTH

Hi folks. Ive got a simple bit of code saying..
Dim score As Integer
score = 0
If Option16.Value = 1 Then
score = score + 1
end if
But i keep geting an error message saying "you entered an expression that has no value"
Anyone got any ideas, this is really frustrating me now!
 

RuralGuy

AWF VIP
Local time
Today, 11:18
Joined
Jul 2, 2005
Messages
13,826
Andy,
Where do you have that code? Is Option16 an OptionGroup control?
 

andyj2k1

New member
Local time
Today, 18:18
Joined
Feb 25, 2007
Messages
3
Thanks for the help guys, its just a option box (radio button) on a form. Still cant get it to work :(
 

unclejoe

Registered User.
Local time
Tomorrow, 01:18
Joined
Dec 27, 2004
Messages
190
Hi,

Then, "Option.Value" should work.

"you entered an expression that has no value"

The code you gave might not come from it. Is there something else in the code? In the VBA editor, where did the line stop?

Thanks for the help guys, its just a option box (radio button) on a form. Still cant get it to work :(
 

Users who are viewing this thread

Top Bottom