Set Focus on a object in a form

M

myseven123

How do I set the focus to a particular object in a form? And can I use a
Control Button to allow this in my form? For example I wanted to allow
someone to add a new record to my form using a control Button labeled 'Add
Entry'. I created a control button to do this with a macro on my form; but I
cannot get the focus to return to a specific object. I was able to do
something like this in Visual Basic 5.0 but I am not sure how (if possible)
using Access 2003.
 
K

Klatuu

You could use the Tab Order of the form and set the control you want to have
the focus to a tab order of 0. If that will not work for you, you can put a
line in the Load event of the form to set the focus:

Me.MyControl.Setfocus
 
L

Linq Adams via AccessMonster.com

YourObjectName.SetFocus
How do I set the focus to a particular object in a form? And can I use a
Control Button to allow this in my form? For example I wanted to allow
someone to add a new record to my form using a control Button labeled 'Add
Entry'. I created a control button to do this with a macro on my form; but I
cannot get the focus to return to a specific object. I was able to do
something like this in Visual Basic 5.0 but I am not sure how (if possible)
using Access 2003.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
M

myseven123

How do I do that?

Klatuu said:
You could use the Tab Order of the form and set the control you want to have
the focus to a tab order of 0. If that will not work for you, you can put a
line in the Load event of the form to set the focus:

Me.MyControl.Setfocus
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top