Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime error 2427, Help

Status
Not open for further replies.

Geo45

Technical User
Jul 17, 2002
19
GB
Hi

In a form I have added an option group and inside this, I added 4 option(radio) buttons. I have not changed any of the properties. Using a command button called cmdsearch, I see which button is selected and then it give a message. heres the code I have used, it works in VB but not ACCESS



heres the simple code

Private Sub cmdsearch_Click()
If Option101 = True Then
MsgBox "1"
End If
If Option103 = True Then
MsgBox "2"
End If
If Option105 = True Then
MsgBox "3"
End If
If Option107 = True Then
MsgBox "4"
End If
End Sub


...but when i run it, in access97, an error comes up.

Runtime error 2427
You entered an expresion that has no value

I have also tried
If Option107.value = True Then

If Option107 Then

and the problem is the same



Please Help
 
This should work

Private Sub cmdsearch_Click()
If Option101.Value = -1 Then
MsgBox "1"
End If
If Option103.Value = -1Then
MsgBox "2"
End If
If Option105.Value = -1 Then
MsgBox "3"
End If
If Option107.Value = -1 Then
MsgBox "4"
End If
End Sub David Lerwill
"If at first you don't succeed go to the pub"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top