Multiple check box fill in using a toggle button

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
 
J

J. Goddard

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
 
G

Guest

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
 
F

FrunkaBlunka

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
 
J

J. Goddard

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top