Consulting

Results 1 to 2 of 2

Thread: Setfocus on another form

  1. #1

    Setfocus on another form

    Hello! Could any one please help me?

    I'm using the code below to open another form
    DoCmd.OpenForm "frmStudent", acNormal

    There's a button on frmStudent that I wish to click
    Please advice how to proceed. Thanks a lot!

  2. #2
    Quote Originally Posted by clemseed
    Hello! Could any one please help me?

    I'm using the code below to open another form
    DoCmd.OpenForm "frmStudent", acNormal

    There's a button on frmStudent that I wish to click
    Please advice how to proceed. Thanks a lot!
    So you want to have the button on frmStudent have the focus as soon as you open the form correct?

    If that is the case, then with the form in design view, View Code, View the event "Private Sub Form_Load". In this section of the code, type in the following:

    Me.Command10.SetFocus

    Change "Command10 to whatever you have named your button and then test the form.

    This line sets the focus to the button as soon as the Form loads.

    I hope this helps!

Posting Permissions

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