click the command button

Discussion in 'AutoCAD' started by jackie, May 12, 2004.

  1. jackie

    jackie Guest

    I have a form with a command button, which leads to the next procedure if
    clicked.

    Sub CommandButton1_Click()
    'process the info from form
    End Sub

    Now I am calling up this form in a loop. How could I click the button
    automatically by vba?

    Sub Main()
    For i = 1 to 100
    MyForm.show
    'the command button on MyForm will need to be click to process info
    Next i
    End Sub
     
    jackie, May 12, 2004
    #1
  2. jackie

    Ed Jobe Guest

    You don't, just call its procedure CommandButton1_Click.

    --
    ----
    Ed
    ----
    I have a form with a command button, which leads to the next procedure if
    clicked.

    Sub CommandButton1_Click()
    'process the info from form
    End Sub

    Now I am calling up this form in a loop. How could I click the button
    automatically by vba?

    Sub Main()
    For i = 1 to 100
    MyForm.show
    'the command button on MyForm will need to be click to process info
    Next i
    End Sub
     
    Ed Jobe, May 12, 2004
    #2
  3. jackie

    Tom Craft Guest

    Sub Main()
    For i = 1 to 100
    MyForm.show
    commandbutton1_click
    Next i
    End Sub
     
    Tom Craft, May 13, 2004
    #3
  4. Hi Tom,

    Shouldn't that be

    MyForm.commandbutton1_click

    just in case there are other commandButton1's on other forms in the project.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, May 13, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.