Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    double buttons (Access 2000)

    Can you help me construct a button with double action ? My first my button is called CmdEvents.The second button is called CmdActions.It is invisible.When i click on Cmdevents i have the event Me.CmdActions.Visible = True.
    But i cannot make CmdEvents invisible. Fot this double actions, is it possible to have only one button instead of two ?

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

    Re: double buttons (Access 2000)

    You could make cmdEvents invisible, but before you do that, you must set the focus to another control, for example cmdActions. You cannot hide the active control. The code would look like this:

    Me.cmdActions.Visible = True
    Me.cmdActions.SetFocus
    Me.cmdEvents.Visible = False

    It would also be possible to use one button. Let's say you use cmdEvents. I has caption "Events". The On Click event procedure could look like this:

    Private Sub cmdEvents_Click()
    If Me.cmdEvents.Caption = "Events" Then
    ' insert the "events" code here
    ...
    ' change the caption to "Actions"
    Me.cmdEvents.Caption = "Actions"
    Else
    ' insert the "actions" code here
    ...
    ' change the caption back to "Events"
    Me.cmdEvents.Caption = "Events"
    End If
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: double buttons (Access 2000)

    Thank you for your perfect answer.So simple and so effective

Posting Permissions

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