Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Toggle button (Access 2000)

    I have two command buttons, CmdNew and CmdOld, where by clicking the first i make the second visible and vice versa for example
    Private Sub CmdNew_Click()
    DoCmd.Rename "offsetTemp", acTable, "offset"
    DoCmd.Rename "offset", acTable, "offsetOld"
    Me!CmdOld.Visible = True
    End Sub

    I want to use only one toggle button instead,with two captions"Old" and "New".

    How could i do that ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Toggle button (Access 2000)

    You could use a single command button cmdSomething with code like this:

    Private Sub cmdSomething_Click()
    If Me.cmdSomething.Caption = "New" Then
    DoCmd.Rename "offsetTemp", acTable, "offset"
    DoCmd.Rename "offset", acTable, "offsetOld"
    Me.cmdSomething.Caption = "Old"
    Else
    ...
    ...
    Me.cmdSomethng.Caption = "New"
    End If
    End Sub

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Toggle button (Access 2000)

    Thank you ! it works justexcellent !

Posting Permissions

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