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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Group

Status
Not open for further replies.

naturalsn

Technical User
Apr 26, 2007
68
GB
Good Morning

I was hoping someone could please assist.

This seems very simple but I get a

runtime error 2427 "You entrered an epression that has no value"
error the whole time.

I have and Option Group call "ApplicationSucc"

Yes / No Option group which is bound to a field in my table called "AppSucc"

The appsucc field is a Yes/No field

I would like on the after update event, if the user selected yes.
I will get a msgbox, requesting if i would like to Generate a document and from there move on.

I currently have very basic still working on the extra bits of code.

Code:
Private Sub ApplicationSucc_AfterUpdate()

If Me.Yes.Value = True Then
  MsgBox "Would you like to Generate the Offer Letter", vbCrLf & vbYesNoCancel
  
If vbYes Then
'docmd open form blah blah blah...

Then

MsgBox "The Candidate would now be move to the Offer Table. Please confirm", vbCrLf & vbYesNoCancel

If vbYes Then
'code - move to offer table...
   
Else
If Me.No.Value = False Then

MsgBox "Would you like to Archive the Candidate", vbCrLf & vbYesNoCancel

If vbYes Then
Me.Status = Archive

End If
End If
End Sub


Now i have been testing

Code:
Private Sub ApplicationSucc_AfterUpdate()

If Me.Yes.Value = True Then
  MsgBox "working"

Else

If Me.No.Value = False Then
  MsgBox "Also Working

but no luck, this is where i get the error.. No i was wondering, if what i am trying to achieve with the above section woul be possible with an option button, and what i might be doing wrong with just the testing piece, to see if i can get a msgbox and addtional events to follow.

Thank you very much in advance

REgards
Sn
 
Are Yes and No two options in an option group? If so, the values will be say, 1 and 2, not true and false. You would say something on the lines of:

[tt]If Me.InsertOptionGroupNameHere=1
'Yes
<...>[/tt]

If you want a simple yes/no, you can have something like:

Code:
Form:
Tick here if the applicant was successful: | |

Code:
If Me.chkSuccess = True
  MsgBox "True"
Else
  MsgBox "False"
End If

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top