Results 1 to 11 of 11

Thread: Solved - Toggle Button Code

Hybrid View

  1. #1
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Toggle Button Code

    Private Sub CommandButton1_Click()
    Static onoff As Boolean
    onoff = Not onoff
    CommandButton1.Caption = -CInt(onoff)
    End Sub

    pete

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Toggle Button Code

    Code:
    Private Sub tglButton_Click()
        tblButton.Caption = iif(tglButton,"1","0")
    End Sub
    Or some thing like that. The true/flase part of the iif may need reversing...

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    10

    Thumbs down Re: Toggle Button Code

    Thks Ecniv...

    that routine only works once, not repeatedly...Rgds, Andreas

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Toggle Button Code

    Uh? only once?
    Should fire each time the toggle button is pressed.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width