Set Form Focus

K

Kevin Baker

Hi everyone,

I have a form with a list box, the user can select the a record and press
the "edit" button or double click the record to trigger the "edit" button
code. My code first opens the "edit record" form, then closes the form with
the List box.. this works great, but after the code runs to close the List
box form, my "edit record" form, loses focus. What code can I use to put
the focus back onto the edit form?

Thanks,
Kevin
 
G

Guest

Try puting after the line of code that close the form with list box enter the
code
forms![FormName].setfocus
 
S

Steve Schapel

Kevin,

This seems strange that it should "lose focus". Where is the focus
being put?

Anyway, this should do it...
DoCmd.SelectObject acForm, "YourEditForm", False
 

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