List Box Focus

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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
 
I just implemented the solution you gave me and it works perfectly. Thankyou
and Happy Hollidays.

Rob
 
Back
Top