|
-
Jul 3rd, 2002, 11:57 AM
#1
Thread Starter
Fanatic Member
***Resolved*** SetFocus problem
Hi everybody,
I use many times Private Sub Form_Load to set some parameters in the Form before the use use it. But I need to set on Fields .SetFocus to start with the correct textfield. Unfortunatly it seems that with Form_Load are the controls are still not loaded. How can I set at Form-start any SetFocus that I want?
In Access exist a Sub that can be called AFTER the form is loaded. I didn't find this in VB.
Any idea how to set the SetFocus?
Franky
Last edited by Franky; Jul 6th, 2002 at 03:31 PM.
-
Jul 3rd, 2002, 04:35 PM
#2
Use the form activate event. When a form is load the load event fires and then the activate event fires when the form becomes the active form.
-
Jul 3rd, 2002, 05:42 PM
#3
PowerPoster
Well
Use something like this :
VB Code:
' In Form Load
' Additional Code
Me.Show
Text1.SetFocus
Problem is you cannot set focus to a control that has not been visually "seen" yet...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Jul 4th, 2002, 09:49 PM
#4
New Member
try this lines:
load form1
form1.show
Last edited by JosephNUy; Jul 4th, 2002 at 09:54 PM.
-
Jul 5th, 2002, 03:19 AM
#5
Or look at your tab order and the text field you want to start in set to 0....
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 6th, 2002, 03:30 PM
#6
Thread Starter
Fanatic Member
Thanks everybody
Nice ideas from all of you. But the best is of course the
Private Sub Form_Activate()
It was the sub that i was looking for.
Thanks again
Franky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|