Vic,
What's a toggle button box? I think you mean you want to be able to select
multiple CheckBoxes, and have the selection stored somewhere, so when you
re-open the form, your selection will be returned.
There is no native way of doing this, however, you can do one of two things.
Firstly, you can add a table field to record the value of each check box.
Secondly, you can add a single Integer field to the table, and use binary
numbers to represent each check box selection.
For example, if we have, say, four check boxes - BoxA, BoxB, BoxC and BoxD.
We assign the boxes a unique value, which when combined, allows us to
determine which one has been selected. So we assign the following values:
BoxA = 1
BoxB = 2
BoxC = 4
BoxD = 8
When you save the record, just add up the values for each ticked box, and
store that value in the Integer field:
Me!txtValue = 0
If Me!BoxA Then Me!xtValue = 1
If Me!BoxB Then Me!txtValue = Me!xtValue + 2
If Me!BoxC Then Me!txtValue = Me!xtValue + 4
If Me!BoxD Then Me!txtValue = Me!xtValue + 8
When you open the form, or navigate to a new record, use the following code
to set the status of each box:
If Nz(Me!txtValue, 0) > 0 Then
Me!BoxA = ((Me!txtValue AND 1) > 0)
Me!BoxB = ((Me!txtValue AND 2) > 0)
Me!BoxC = ((Me!txtValue AND 4) > 0)
Me!BoxD = ((Me!txtValue AND 8) > 0)
End If
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html