making option groups visible/invisible based on another option group selection

  • Thread starter Thread starter Emma
  • Start date Start date
E

Emma

I have a form on which there are 3 option groups. my
first option group determines which of two other options
groups will be visible to to user. I have placed the
following code in the afterupdate event of the first
option group. I know it's wrong. Can someone help me out
with the correct code?

Private Sub Request_Type_Frame_AfterUpdate()
'Hide or Unhide Purpose Frame
'Request Type either 1 or 2
Select Case Request_Type_Frame(Request_Type)
'If Request_Type is 1 Show only Sponsorship frame and hide
Consulting frame
Case 1 Sponsorship_Purpose_Frame.Visible

'...I'm not sure how to make the Consulting_Purpose_Frame
invisible here
Consulting_Purpose_Frame.Visible = False

'If Request_Type is 2 show only Consulting Frame and hide
sponsorship frame
Case 2 Consulting_Purpose_Frame.Visible = true

'...same here for the Sponsorship_Purpose_Frame here
Sponsorship_Purpose_Frame.Visible = False

End Select
End Sub

Your help is much appreciated!!

Emma
 
Emma said:
I have a form on which there are 3 option groups. my
first option group determines which of two other options
groups will be visible to to user. I have placed the
following code in the afterupdate event of the first
option group. I know it's wrong. Can someone help me out
with the correct code?

Private Sub Request_Type_Frame_AfterUpdate()
'Hide or Unhide Purpose Frame
'Request Type either 1 or 2
Select Case Request_Type_Frame(Request_Type)
'If Request_Type is 1 Show only Sponsorship frame and hide
Consulting frame
Case 1 Sponsorship_Purpose_Frame.Visible

'...I'm not sure how to make the Consulting_Purpose_Frame
invisible here
Consulting_Purpose_Frame.Visible = False

'If Request_Type is 2 show only Consulting Frame and hide
sponsorship frame
Case 2 Consulting_Purpose_Frame.Visible = true

'...same here for the Sponsorship_Purpose_Frame here
Sponsorship_Purpose_Frame.Visible = False

End Select
End Sub

Your help is much appreciated!!

Emma

Try this:

'------ start of revised code -----
Private Sub Request_Type_Frame_AfterUpdate()

'Hide or Unhide Purpose Frames

Select Case Me!Request_Type_Frame

Case 1
' Show only Sponsorship frame and hide
' Consulting frame
Me!Sponsorship_Purpose_Frame.Visible = True
Me!Consulting_Purpose_Frame.Visible = False

Case 2
' Show only Consulting Frame and hide
' sponsorship frame
Me!Consulting_Purpose_Frame.Visible = True
Me!Sponsorship_Purpose_Frame.Visible = False

End Select

End Sub
'------ end of revised code -----
 
You are wonderful!!!
-----Original Message-----


Try this:

'------ start of revised code -----
Private Sub Request_Type_Frame_AfterUpdate()

'Hide or Unhide Purpose Frames

Select Case Me!Request_Type_Frame

Case 1
' Show only Sponsorship frame and hide
' Consulting frame
Me!Sponsorship_Purpose_Frame.Visible = True
Me!Consulting_Purpose_Frame.Visible = False

Case 2
' Show only Consulting Frame and hide
' sponsorship frame
Me!Consulting_Purpose_Frame.Visible = True
Me!Sponsorship_Purpose_Frame.Visible = False

End Select

End Sub
'------ end of revised code -----

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
Back
Top