Results 1 to 5 of 5

Thread: [RESOLVED] calling a button from another button

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    5

    Resolved [RESOLVED] calling a button from another button

    Hi all

    How do I "click" one button on a form by clicking a different one?

    Thanks

    Josh

  2. #2
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Smile Re: calling a button from another button

    Try this!
    Code:
    Private Sub Command1_Click()
        Command2_Click
    End Sub
    
    Private Sub Command2_Click()
        MsgBox "test"
    End Sub

  3. #3
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: calling a button from another button

    Different forms....
    vb Code:
    1. Private Sub Command1_Click()
    2.     Form1.Command2_Click
    3. End Sub
    4.  
    5. 'In your other form
    6. Sub Command2_Click()
    7.     MsgBox "something!"
    8. End Sub

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: calling a button from another button

    I would use
    vb Code:
    1. Form1.Command1.Value = True

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    5

    Re: calling a button from another button

    Thanks all I got it working using value = true

    I tried the others but got a Data Method not found error

    thanks again

    Josh

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