Multiple Toggle buttons working together

quicksilver1024

Registered User.
Local time
Today, 09:53
Joined
Jul 17, 2007
Messages
37
Hi - I have another problem. I hope you can help me out on this one.

Right now, I have 3 toggle buttons to control the visibility of 3 subforms. However, I only want a single subform to show at any given time. So, if I were to select toggle 1 it should give me subform 1, and afterwards if I select toggle 2 it should give me subform 2 WITHOUT showing me toggle 1.

Is there anyway to get the toggle buttons to work with each other?

Thanks,
:)
 
Different ways to go depending on the look you want. One way would be to disable the other 2 buttons when 1 was clicked. When it's un-clicked, re-enable the other 2. Or, when any button is clicked, set the 1 subform to visible and the others to not visible.
 
hi pbaldy

how would you go about disabling the other two subforms?
can you give me a code snippet?
 
I would disable the button, not the subform.

Me.ButtonName.Enabled = False
 
No dice.

After de-activating the toggle button the other toggle's don't re-appear.
Sorry, I'm a first time user of Access and VBA.
 
You would have to code it; it won't happen automatically. Since you're using toggle buttons, try this in the click event of Button1:

Code:
  If Me.Button1 = True Then
    Me.Button2.Enabled = False
  Else
    Me.Button2.Enabled = True
  End If
 
I have the following:

"Private Sub Rewinder_Open_Click()
If Rewinder_Open = 0 Then
Me.Manual_Entry_Master_Subform.Visible = False
Me.Wrapper1_Open.Enabled = True
Me.Wrapper2_Open.Enabled = True
Else
Me.Manual_Entry_Master_Subform.Visible = True
Me.Wrapper1_Open.Enabled = False
Me.Wrapper2_Open.Enabled = False
End If
End Sub"

But isn't there a way to not disable the other toggle buttons? It's a small nuissance having to re-click the toggle button to activate the other buttons.
 
I already mentioned a method that would do that:

Or, when any button is clicked, set the 1 subform to visible and the others to not visible.

For the record, you could also use an option group to select which subform is visible.
 
Okay, I think I know where the confusion is.

I want to be able to click on the other toggle buttons while I am already in a toggled subform. However, when I click on the new toggle button the button from before should no longer be selected.

Right now, I can select (or push-in) multiple toggle buttons but since they toggle the visibilities of the subforms this causes a slight problem
 
Ahh

That was easy!
It works now,

"Private Sub Rewinder_Open_Click()
If Rewinder_Open = 0 Then
Me.Manual_Entry_Master_Rewinder_Subform.Visible = False
Else
Me.Manual_Entry_Master_Rewinder_Subform.Visible = True
Wrapper1_Open = 0
Wrapper2_Open = 0
End If
End Sub"

Thanks pbaldy for nudging me in the right direction
 
I probably wouldn't use toggle buttons in this case. I use them when I want something to happen when clicked down and something different when released. They would be appropriate here if you wanted to toggle the visibility of any particular form. It sounds like you just want to switch the visible form, so I'd use regular buttons and do like I mentioned in post 8. If you want to keep them, you can set the value of the other toggles when you click one. They have a true/false value to signify whether they are down or up.
 
Now a more complicated problem.

Please see my attached project file. The forms "Manual_Entry_Master" and "Manual_Entry_Master_Detail" are the main focus.

In the subform, I have the MACHINE_NAME Combo box of which a machine name from the list is to be selected. In the space below it, the user inputs problems on the plant floor related to that particular machine (as selected in the combo).

A user should be able to click for example, Rewinder, to input problems for machines under the rewinder category. After clicking, the correct subform should appear (fixed now), then the user would go and select the Machine name from the combo box, but this list should depend on what was selected from the toggle box. I have already setup the tables for this. After that has been selected, the text box beside the MACHINE_NAME combo should display what has been selected in the toggle box.

How can I achieve this? I tried to be as detailed as possible in my description, but please feel free to ask for more details if required.

THANK YOU IN ADVANCE!
 

Attachments

I guess I don't understand. If you're going to have 3 subforms, then each could be configured for the button that will display it. I would do what you're describing if I had one subform, and needed to change something about it depending on the selection. I must be missing something.
 
Hmm..
I am confused. Isn't what I am doing the same as what you just said? Each subform is activitated by each toggle button. The toggle button could have been just regular buttons, but I wanted so that it would be possible to have no subforms showing.
 
Hmm..
I am confused. Isn't what I am doing the same as what you just said? Each subform is activitated by each toggle button. The toggle button could have been just regular buttons, but I wanted so that it would be possible to have no subforms showing.

First of all, your current code is referencing an item that doesn't exist. You currently (based on the file you posted) have only ONE subform on the form. If you want to display them just using Visible = True or hide them using Visible = False, you will need to actually have all of the subforms on the form.
 
OH!

I'm sorry. Yes, I only made one subform because I wanted to solve the problems of that subform first then I could go copy and paste the subform and make small changes to it to make it the other 2 subforms.

:p
 
I have an idea, how about for each problem (subform->Detail) I add a hidden field that points to the value selected in the MACHINE_NAME combo box and the corresponding MACHINE_CATEGORY?

How does addressing work in Access?
 

Users who are viewing this thread

Back
Top Bottom