List Box Focus

G

Guest

I have a listbox that displays the date, type of visit, and procedure name on
a form. the user clicks thru the list to load the entire visit info into the
visit form (which is the form that the listbox resides on.) the problem is
that after a new visit is added and the listbox updates, the newly listed
item does not have the focus in the listbox, the previously chosen visit has.
the visit form shows the new visit info, but the listbox has a different
record highlighted.

How can I set the focus on the new record in the listbox once the new record
is added?

Thanks for your help. Happy Hollidays to all.

RobUCSD
 
F

fredg

I have a listbox that displays the date, type of visit, and procedure name on
a form. the user clicks thru the list to load the entire visit info into the
visit form (which is the form that the listbox resides on.) the problem is
that after a new visit is added and the listbox updates, the newly listed
item does not have the focus in the listbox, the previously chosen visit has.
the visit form shows the new visit info, but the listbox has a different
record highlighted.

How can I set the focus on the new record in the listbox once the new record
is added?

Thanks for your help. Happy Hollidays to all.

RobUCSD

Why not just code the Form's Current event:

Me!ListBoxName.SetFocus
 
G

Guest

thanks for your quick reply. I tried your suggestion and it didn't help. I
need the focus to be set on the newly added item in the listbox. Currently
the focus remains with the previously selected item in the listbox before a
new record was created.

something like this

Me!lstVisit.SetFocus = newly added record

Thanks the help
 
G

Guest

still looking for help, pls

RobUCSD said:
thanks for your quick reply. I tried your suggestion and it didn't help. I
need the focus to be set on the newly added item in the listbox. Currently
the focus remains with the previously selected item in the listbox before a
new record was created.

something like this

Me!lstVisit.SetFocus = newly added record

Thanks the help
 
G

Guest

I just implemented the solution you gave me and it works perfectly. Thankyou
and Happy Hollidays.

Rob
 

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

Similar Threads


Top