View Full Version : Setfocus on another form
clemseed
03-31-2013, 08:24 PM
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!
dmessimer
04-01-2013, 10:01 AM
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!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.