dbTalk Databases Forums  

Many Toggle Buttons

comp.databases.ms-access comp.databases.ms-access


Discuss Many Toggle Buttons in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rachel
 
Posts: n/a

Default Many Toggle Buttons - 08-01-2003 , 12:37 PM






I have over two hundred toggle buttons on a form. Is there a way to write
"general" code rather than code each button that will turn the font red on the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have individual buttons
react to On and Off.

Thanks!

Rachel



Reply With Quote
  #2  
Old   
Rachel
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-01-2003 , 03:23 PM






Sel,

I looked through Forms, APIs and Modules and did not find anything referencing
my issue. Can you be more specific as to where to look.

Thanks!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote

Quote:
"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:5zxWa.30206$Mc.2357688 (AT) newsread1 (DOT) prod.itd.earthlink.net...
I have over two hundred toggle buttons on a form. Is there a way to write
"general" code rather than code each button that will turn the font red on
the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have individual
buttons
react to On and Off.

Thanks!

Rachel



Check out this site:
http://www.mvps.org/access/

MVPs often build forms with 200 or more toggle buttons.

HTH
Selworth Short, MVP
This posting is provided "AS IS" with
no warranties, and confers no rights.






Reply With Quote
  #3  
Old   
Rachel
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-01-2003 , 03:43 PM



Hey, mister, thanks for wasting my time!!!

Why don't you mind your own business when you don't have anything constructive
to say.

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote

Quote:
Sorry, lady, I though your post was a joke. Larry Linson, our resident MVP
sickboy, is always posting messages like yours.

To be frank, you really need to rethink what you are doing. Any
professional developer will tell you that the number of toggle buttons you
are using is absurd (thus the implication that your post was a "professional
joke.")

Sel

PS: Maybe if you explain what you hope to achieve with more than 200 toggle
buttons, something more can be suggested.


"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:M_zWa.128755$Io.10918516 (AT) newsread2 (DOT) prod.itd.earthlink.net...
Sel,

I looked through Forms, APIs and Modules and did not find anything
referencing
my issue. Can you be more specific as to where to look.

Thanks!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:5e35463cf291807c0023f831dfa4dd48 (AT) free (DOT) teranews.com...

"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:5zxWa.30206$Mc.2357688 (AT) newsread1 (DOT) prod.itd.earthlink.net...
I have over two hundred toggle buttons on a form. Is there a way to
write
"general" code rather than code each button that will turn the font
red on
the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have individual
buttons
react to On and Off.

Thanks!

Rachel



Check out this site:
http://www.mvps.org/access/

MVPs often build forms with 200 or more toggle buttons.

HTH
Selworth Short, MVP
This posting is provided "AS IS" with
no warranties, and confers no rights.











Reply With Quote
  #4  
Old   
Sel Short
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-01-2003 , 03:58 PM



Sorry, lady, I though your post was a joke. Larry Linson, our resident MVP
sickboy, is always posting messages like yours.

To be frank, you really need to rethink what you are doing. Any
professional developer will tell you that the number of toggle buttons you
are using is absurd (thus the implication that your post was a "professional
joke.")

Sel

PS: Maybe if you explain what you hope to achieve with more than 200 toggle
buttons, something more can be suggested.


"Rachel" <rlaird (AT) penn (DOT) com> wrote

Quote:
Sel,

I looked through Forms, APIs and Modules and did not find anything
referencing
my issue. Can you be more specific as to where to look.

Thanks!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:5e35463cf291807c0023f831dfa4dd48 (AT) free (DOT) teranews.com...

"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:5zxWa.30206$Mc.2357688 (AT) newsread1 (DOT) prod.itd.earthlink.net...
I have over two hundred toggle buttons on a form. Is there a way to
write
"general" code rather than code each button that will turn the font
red on
the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have individual
buttons
react to On and Off.

Thanks!

Rachel



Check out this site:
http://www.mvps.org/access/

MVPs often build forms with 200 or more toggle buttons.

HTH
Selworth Short, MVP
This posting is provided "AS IS" with
no warranties, and confers no rights.








Reply With Quote
  #5  
Old   
Rachel
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-01-2003 , 04:04 PM



My name isn't Larry!

My original post was a legitimate request for help!

You're not only rude but ignorant!!!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote

Quote:
OK, Larry, you got me.


"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:GhAWa.128793$Io.10919529 (AT) newsread2 (DOT) prod.itd.earthlink.net...
Hey, mister, thanks for wasting my time!!!

Why don't you mind your own business when you don't have anything
constructive
to say.

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:759241b260defdd605f94f257b6bc7c5 (AT) free (DOT) teranews.com...
Sorry, lady, I though your post was a joke. Larry Linson, our resident
MVP
sickboy, is always posting messages like yours.

To be frank, you really need to rethink what you are doing. Any
professional developer will tell you that the number of toggle buttons
you
are using is absurd (thus the implication that your post was a
"professional
joke.")

Sel

PS: Maybe if you explain what you hope to achieve with more than 200
toggle
buttons, something more can be suggested.


"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:M_zWa.128755$Io.10918516 (AT) newsread2 (DOT) prod.itd.earthlink.net...
Sel,

I looked through Forms, APIs and Modules and did not find anything
referencing
my issue. Can you be more specific as to where to look.

Thanks!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:5e35463cf291807c0023f831dfa4dd48 (AT) free (DOT) teranews.com...

"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:5zxWa.30206$Mc.2357688 (AT) newsread1 (DOT) prod.itd.earthlink.net...
I have over two hundred toggle buttons on a form. Is there a way
to
write
"general" code rather than code each button that will turn the
font
red on
the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have
individual
buttons
react to On and Off.

Thanks!

Rachel



Check out this site:
http://www.mvps.org/access/

MVPs often build forms with 200 or more toggle buttons.

HTH
Selworth Short, MVP
This posting is provided "AS IS" with
no warranties, and confers no rights.
















Reply With Quote
  #6  
Old   
Sel Short
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-01-2003 , 04:05 PM




OK, Larry, you got me.


"Rachel" <rlaird (AT) penn (DOT) com> wrote

Quote:
Hey, mister, thanks for wasting my time!!!

Why don't you mind your own business when you don't have anything
constructive
to say.

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:759241b260defdd605f94f257b6bc7c5 (AT) free (DOT) teranews.com...
Sorry, lady, I though your post was a joke. Larry Linson, our resident
MVP
sickboy, is always posting messages like yours.

To be frank, you really need to rethink what you are doing. Any
professional developer will tell you that the number of toggle buttons
you
are using is absurd (thus the implication that your post was a
"professional
joke.")

Sel

PS: Maybe if you explain what you hope to achieve with more than 200
toggle
buttons, something more can be suggested.


"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:M_zWa.128755$Io.10918516 (AT) newsread2 (DOT) prod.itd.earthlink.net...
Sel,

I looked through Forms, APIs and Modules and did not find anything
referencing
my issue. Can you be more specific as to where to look.

Thanks!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:5e35463cf291807c0023f831dfa4dd48 (AT) free (DOT) teranews.com...

"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:5zxWa.30206$Mc.2357688 (AT) newsread1 (DOT) prod.itd.earthlink.net...
I have over two hundred toggle buttons on a form. Is there a way
to
write
"general" code rather than code each button that will turn the
font
red on
the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have
individual
buttons
react to On and Off.

Thanks!

Rachel



Check out this site:
http://www.mvps.org/access/

MVPs often build forms with 200 or more toggle buttons.

HTH
Selworth Short, MVP
This posting is provided "AS IS" with
no warranties, and confers no rights.













Reply With Quote
  #7  
Old   
Jayson Blair
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-01-2003 , 04:07 PM




"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote

Quote:
"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:5zxWa.30206$Mc.2357688 (AT) newsread1 (DOT) prod.itd.earthlink.net...
I have over two hundred toggle buttons on a form. Is there a way to
write
"general" code rather than code each button that will turn the font red
on
the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have individual
buttons
react to On and Off.

Thanks!

Rachel



Check out this site:
http://www.mvps.org/access/

MVPs often build forms with 200 or more toggle buttons.

HTH
Selworth Short, MVP
This posting is provided "AS IS" with
no warranties, and confers no rights.

You should have told her to post a screenshot of her form on MitchKa's site.
Arvin and I are always looking for good designs.

Jayson





Reply With Quote
  #8  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-01-2003 , 10:07 PM



Rachel wrote:
Quote:
I have over two hundred toggle buttons on a form. Is there a way to write
"general" code rather than code each button that will turn the font red on the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have individual buttons
react to On and Off.

Thanks!

Rachel
Chuck's reply is correct. You will have to have the code called on an
event for each command/toggle button

You could do something like this...this is untested code but you should
get the general drift and you can modify it to suit your needs. It
basically writed all of the code for you if you want the code in each
toggke button.

Sub WriteToggleRoutine()
Dim sf As String
Dim f as Form
Dim c as Control
sf = "YourFormName" 'subtitute YourFormName with the form's bame.
Docmd.openform f,acdesing,,,,acHidden
set f = Forms(sf)

Open "Toggle.Txt" For OutPut As #1

For each c in f.controls
'loop through each label, combo, text, toggle
if ctl.ControlType = acToggleButton then
'let's say you want to call this on the onclick event
Print "Private Sub " & _
ctl.name & "_OnClick()"
Print chr(9) & "SetFontToRed"
Print "End Sub"
endif
next
Close #1
msgbox "Done"
End Sub

Now open up Toggle.Txt and paste it into the code. You want to have
this call the routine you are going to call in. Let's say the rootine
you are going to call is SetFontToRed. You could make that
Print chr(9) & "SetFontToRed(Me)"
or
Print chr(9) & "SetFontToRed(Me,ActiveControl)"

hen in your SetFontToRed sub you have the form name or the control name
that you called.
Private Sub SetFontToRead(frm As Form, ctl As Control)


Reply With Quote
  #9  
Old   
Larry Linson
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-02-2003 , 04:02 PM



Rachel,

Sel Short is, in fact, Don P Mellon, the resident troll in this newsgroup.
He's definitely unfond of MVPs, sometimes impersonates them, and always
tries to either belittle them or make them look bad.

I don't see that my response to your post actually made it to the server,
but I said that you could write DAO code to execute in the design view of
the Form to set the contents of the event property of those controls --
fairly simple code, and thus you won't have to manually enter the
information for each.

I also said that will be a pretty "busy" form, it won't be awfully
user-friendly, and maybe you should take another look at the design to see
if you can't group the functionality so you don't have so many toggle
buttons on the same form.

Larry Linson
Microsoft Access MVP



"Rachel" <rlaird (AT) penn (DOT) com> wrote

Quote:
My name isn't Larry!

My original post was a legitimate request for help!

You're not only rude but ignorant!!!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:57f5b6474a88a8ac8b5201847d5f42c9 (AT) free (DOT) teranews.com...

OK, Larry, you got me.


"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:GhAWa.128793$Io.10919529 (AT) newsread2 (DOT) prod.itd.earthlink.net...
Hey, mister, thanks for wasting my time!!!

Why don't you mind your own business when you don't have anything
constructive
to say.

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:759241b260defdd605f94f257b6bc7c5 (AT) free (DOT) teranews.com...
Sorry, lady, I though your post was a joke. Larry Linson, our
resident
MVP
sickboy, is always posting messages like yours.

To be frank, you really need to rethink what you are doing. Any
professional developer will tell you that the number of toggle
buttons
you
are using is absurd (thus the implication that your post was a
"professional
joke.")

Sel

PS: Maybe if you explain what you hope to achieve with more than
200
toggle
buttons, something more can be suggested.


"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:M_zWa.128755$Io.10918516 (AT) newsread2 (DOT) prod.itd.earthlink.net...
Sel,

I looked through Forms, APIs and Modules and did not find anything
referencing
my issue. Can you be more specific as to where to look.

Thanks!

Rachel


"Sel Short" <ss987610 (AT) hotmail (DOT) com> wrote in message
news:5e35463cf291807c0023f831dfa4dd48 (AT) free (DOT) teranews.com...

"Rachel" <rlaird (AT) penn (DOT) com> wrote in message
news:5zxWa.30206$Mc.2357688 (AT) newsread1 (DOT) prod.itd.earthlink.net...
I have over two hundred toggle buttons on a form. Is there a
way
to
write
"general" code rather than code each button that will turn the
font
red on
the
button I turn on and turn the font back on the button I turn
off?

I'm trying to save not having to code each button but have
individual
buttons
react to On and Off.

Thanks!

Rachel



Check out this site:
http://www.mvps.org/access/

MVPs often build forms with 200 or more toggle buttons.

HTH
Selworth Short, MVP
This posting is provided "AS IS" with
no warranties, and confers no rights.


















Reply With Quote
  #10  
Old   
TR
 
Posts: n/a

Default Re: Many Toggle Buttons - 08-02-2003 , 08:55 PM



From your post, its not clear whether these are 200 stand-alone toggles, or
an option group with 200 toggles. But if the behaviour is such that turning
one "on" turns the prior button off, then it certainly sounds like an option
group.
If so, you can use naming conventions and the option group afterupdate event
to make this easy.
Name your buttons tog1, tog2, tog3.... up to 200. I am assuming the the
underlying toggle values correspond to their name, i.e. tog1 = 1, etc.
Declare a module level variable
Dim strPriorButton as string

In the afterupdate event of the option group(opgLotsaButtons) use something
like:
Me!("tog" & me!opgLotsaButtons).Forecolor = 255
If Len(strPriorButton)>0 then
Me!(strPriorButton).Forecolor = 0
End if
strPriorButton ="tog" & me!opgLotsaButtons


"Rachel" <rlaird (AT) penn (DOT) com> wrote

Quote:
I have over two hundred toggle buttons on a form. Is there a way to write
"general" code rather than code each button that will turn the font red on
the
button I turn on and turn the font back on the button I turn off?

I'm trying to save not having to code each button but have individual
buttons
react to On and Off.

Thanks!

Rachel





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.