Toggle Button

GSchafer1

Registered User.
Local time
Today, 19:49
Joined
Mar 13, 2000
Messages
22
I'm trying to use a toggle button to enable a combo box that in turn selects different subforms depending on the entry in the combo box. The default "button on"should leave the combo box enabled and visable. If the default toggle button is not selected then I want the combo box and all the subforms related to it to be invisable and disabled. Since I'm not a VB person I hope you experts can help me solve this. If you need more information I will be happy to provide it. Thank you in advance.
 
In the AfterUpdate event for the toggle button, have some code check the status of the toggle button and perform tasks like this (assuming your toggle button is called tglButton):
If (Me.tglButton) Then
  'Stuff to do if button is on
Else
  'Stuff to do if button is off
End If


You should also reference that code from the form load or open event so the initial condition is set.
 
toggle button

I can't find the afterupdate event on the event tab???
 
Re: toggle button

GSchafer1 said:
I can't find the afterupdate event on the event tab???

Open the form in design mode, rightclick on your toggle button and go to Properties, scroll down to AfterUpdate and change the dropdown to [EventProcedure] now click on the "...." button next to the dropdown. This is where you enter the code.

IMO
 
toggle button

I didn't mention that the toggle button is one of two in an option group. There is an After Update in the option group but there isn't one in the toggle button properties. Or maybe I'm just blind???
 
Last edited:
Ahh, Option Group. Then you'll need somthing like this in the After Update Event.


Private Sub YourFrame_AfterUpdate()

Select Case Me.YourFrame.Value

Case 1
Me.YourCombo.Enabled = True

Case 2
Me.YourCombo.Enabled = False

Case Else
Exit Sub
End Select

End Sub


IMO
 
Thanks alot! I'll see if I can make it work. You guys are the tops!
 

Users who are viewing this thread

Back
Top Bottom