Results 1 to 5 of 5

Thread: Command Button

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Ireland
    Posts
    224

    Question

    I have scheduled my program using the windows scheduler and I want to know how I can get the command button to automatically click when the program starts. Any help is greatly appreciated.
    Thanks
    JK

  2. #2
    Lively Member
    Join Date
    Jun 2000
    Location
    Belgium
    Posts
    77
    Just by launch this code
    Code:
    MyCommandButton_Click
    in your load or activate event (if your command button's name MyCommandButton)
    KWell

  3. #3
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    change

    Private Sub Command1_Click()

    to

    Public Sub Command1_Click()


    and call Command1_Click() when you load the program

    *this isn't the right way to go about this, but it will do the job.

    You would be better off putting the code into class modules, and calling the methods from switches from the command line, using the Command() object.
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Ireland
    Posts
    224

    Wink Great

    Thanks a lot
    JK

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You may also use the Value property of the CommandButton.
    Code:
    Command1.Value = True
    The above code will raise the Click event of the button.

    Best regards

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