Hide/Show controls based on value of radio button

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
 
J

Jeff Boyce

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
 
J

Josh

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!
 

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