Toggle buttons

Amit112

Board Regular
Joined
Nov 12, 2004
Messages
52
Hi Guys,
I am having a terrible time with this database. There is now a new problem.

On the side I have toggle buttons. They read ACTIVE ON HOLD CLOSED

The problem is, every time the record changes, the button remains the same. I need it to pop back out every time I change the record. So if I go to record 2, it has to let me choose again which one I would like to press. Thanks guys. I have no idea what im doing so a detailed explanation would help.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
The only way I can think of to manage this requires you to control your navigation through the records with custom buttons instead of using the default/built-in recordselector or navigation buttons (those arrows at the bottom of the form)

If you're not already doing it, create a new button on your form, then in the wizard, select record navigation and then "Next Record". Open up the vba module behind it and modify it to include code that modifies your toggle button controls.

Here's an example of how to use a command button to toggle the apparent position of a toggle button called togMine

Code:
Private Sub Command38_Click()

If Me.togMine.Value = True Then
  Me.togMine.Value = False
Else
  Me.togMine.Value = True
End If

End Sub

What you'll end up needing to do is figure out what rules determine the position of your toggle buttons. For example, is it the value in a field in the same record? If yes, then you'd do something like (this assumes you have a value of True/False in fieldname1

Me.toggleName1.Value = Me.fieldname1
Me.toggleName2.Value = Me.fieldname2
Me.toggleName3.Value = Me.fieldname3

Mike
 
Upvote 0
Sorry - this works. Tested it to be certain as I was typing it out.
What specifically seems to be the problem?
What do you not understand?

The only thing I could add is, instead of setting it so that it reads a stored value in the record, just set it so hitting the 'next record' button sets the toggle button to 'false'

False is the 'up'/unclicked position.

Mike
 
Upvote 0

Forum statistics

Threads
1,221,842
Messages
6,162,333
Members
451,760
Latest member
samue Thon Ajaladin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top