Option Button Value

G

Guest

I have an option group on a form that has two unbound radio buttons; optPacer
(value =1) and optICD (value =2). If optPacer is selected I'm trying to use
it to select rowSource for a combo box on my form.

I get the msg; Error 2427 (you entered an expression that has no value) in
the procedure cmdMedtronicFilter

I'm trying to say that if optPacer is selected then run the query.

Any help would be greatly appreciated.
**********************************************************



Private Sub cmdMedtronicFilter_Click()
On Error GoTo cmdMedtronicFilter_Click_Error


If Me.optPacer.Value = True Then

Me.cboPacerExplant.RowSource = "SELECT * FROM tblPacerLU " & _
"WHERE fldManufactureNo IN('2') " & "ORDER BY fldModelName"

End If


On Error GoTo 0
Exit Sub

cmdMedtronicFilter_Click_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
cmdMedtronicFilter_Click of VBA Document Form_frmDevices"

End Sub
 
R

Rick Brandt

RobUCSD said:
I have an option group on a form that has two unbound radio buttons;
optPacer (value =1) and optICD (value =2). If optPacer is selected
I'm trying to use it to select rowSource for a combo box on my form.

I get the msg; Error 2427 (you entered an expression that has no
value) in the procedure cmdMedtronicFilter

I'm trying to say that if optPacer is selected then run the query.

Any help would be greatly appreciated.
**********************************************************

Don't test the value of the individual radio buttons. Test the value of the
OptionGroup.
 
G

Guest

That makes sense Rick. My problem is that I'm using Access 2007 and the
option group choice in design view only places a rectangle on the form. I
can't seem to group the rectangle and the two buttons. Both buttons can be
selected at the same time. Do you have any hints?

Thanks, Rob
 
R

Rick Brandt

RobUCSD said:
That makes sense Rick. My problem is that I'm using Access 2007 and
the option group choice in design view only places a rectangle on the
form. I can't seem to group the rectangle and the two buttons. Both
buttons can be selected at the same time. Do you have any hints?

Are the RadioButtons actually "inside" the option group? If you move a
RadioButton by dragging it past the edge of the OptionGroup frame the frame
should stretch with it. If it does not, then you never got the RadioButtons
inside the frame. Cut them to the clipboard, select the frame, then paste.
 
G

Guest

thanks Rick, that worked. Happy Easter.

R

Rick Brandt said:
Are the RadioButtons actually "inside" the option group? If you move a
RadioButton by dragging it past the edge of the OptionGroup frame the frame
should stretch with it. If it does not, then you never got the RadioButtons
inside the frame. Cut them to the clipboard, select the frame, then paste.
 

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