Hide/Show controls based on value of radio button

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

I need to hide/show some controls on a form based on the value of a
radio button. This is what I have so far and it doesn't seem to be
working correctly. My two buttons have a value of 1 and 2
respectively.

Private Sub Frame4_Click()
Select Case Frame4.Value
Case 1
Me.Combo15.Visible = False
Me.cmdUpdateRole.Enabled = False
Me.cmdEditUser.Visible = False
Call ShowEditControls 'we will need the same controls as
our edit form
Me.txtUsername.Visible = True
Call clearForm 'just in case
End Select
Select Case Me.optEdit.Value
Case 2
Me.Combo15.Visible = False
Me.cmdUpdateRole.Enabled = False
Me.cmdEditUser.Visible = False
Call ShowEditControls 'we will need the same controls as
our edit form
Me.txtUsername.Visible = True
End Select
End Sub
 
Josh

General descriptions lead to general suggestions -- you haven't described
the symptoms, merely that it "doesn't seem to be working correctly".

Have you tried setting a breakpoint at the start of the Select statement and
stepping through when the procedure runs?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Josh

General descriptions lead to general suggestions -- you haven't described
the symptoms, merely that it "doesn't seem to be working correctly".

Have you tried setting a breakpoint at the start of the Select statement and
stepping through when the procedure runs?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Wow, simple mistake on my part. I referenced the Frame4.Value in the
first case and the optEdit.Value in the second. optEdit has no value.
DOH!
 
Back
Top