Multiple check box fill in using a toggle button

  • Thread starter Thread starter FrunkaBlunka
  • Start date Start date
F

FrunkaBlunka

Hi,

My question is pretty simple but I cant seem to get the code right :(.
I have 5 checkboxes that have 5 separate control sources on a table
called ProjectDetails.

chkMach
chkPrep
chkBoard
chkLay
chkAssemble

I also have a toggle button (tglPanelsBuilt) that is the table Project
Details. At the moment I can check the different boxes which is cool
but once you press the toggle button i would like all the other blank
check boxes to fill instead of having to click all of them.

Thanks

Blunka
 
Hi -

Are you sure you want a toggle button? I don't use them, but in a quick
test it did not update the underlying data it is bound to - in fact the
On Click didn't do anything - even a msgbox didn't work.

If you just want to click a button to fill all the checkboxes, use a
coomand button, and in the after update event for the command button,
just set all the checkboxes to true:

me!chkmach = True
etc. - one line for each



John
 
Toggle buttons do not have a Click event. The only use for a Toggle button
would be to either Check or Uncheck all the buttons.

To do that, you would use the Click event of the option group the buttons
are in.

So, create an option group with two buttons - Check and Un Check. Make the
Option Value of Check -1 and Un Check 0

Then in the click event.

With Me
.chkMach = .opgSetChecks
.chkPrep = .opgSetChecks
.chkBoard = .opgSetChecks
.chkLay = .opgSetChecks
.chkAssemble = .opgSetChecks
End With
 
Thanks guys works great now.
Klatuu said:
Toggle buttons do not have a Click event. The only use for a Toggle button
would be to either Check or Uncheck all the buttons.

To do that, you would use the Click event of the option group the buttons
are in.

So, create an option group with two buttons - Check and Un Check. Make the
Option Value of Check -1 and Un Check 0

Then in the click event.

With Me
.chkMach = .opgSetChecks
.chkPrep = .opgSetChecks
.chkBoard = .opgSetChecks
.chkLay = .opgSetChecks
.chkAssemble = .opgSetChecks
End With
 
Hi
Toggle buttons do not have a Click event. ....

I find that curious - in A2000 I created one as a test, and all the
events are in the properties list - On Click, On DblClick, etc. , and I
can put code in.

It (the code) just doesn't seem to DO anything!
Wonderfully confusing!

John
 
Interesting. I'll have to check my 2000 at home. Here I use 2003 and the
toggle button (not the frame) has only the following events:
Got Focus
Mouse Down
Mouse Move
Mouse Up
Key Down
Key Up
Key Press
 
Back
Top