Listbox Click does nothing

S

Stuart Grant

I have a simple form with a listbox and a group of textboxes all based on
the same query. The listbox has three columns - an ID autonumber, with
width 0 and two columns with LastName,FirstName. The textboxes have deails
on each record.
The form comes up with focus on the first record in the listbox and the
correct details in the text boxes. But if I click on another line in the
listbox, nothing happens the focus doesn't move and the details remain those
of the first entry.

If I press Enter then it moves to the next line in the listbox and the
details change correctly. If I add navigation buttons it also moves
correctly. Bound column is Column1, the ID.

Why doesn't simply clicking work ? I Haven't written any code for the
Listbox click event because I thought this was automatic.

What's wrong ?

Stuart
 
R

Rick Brandt

Stuart said:
I have a simple form with a listbox and a group of textboxes all
based on the same query. The listbox has three columns - an ID
autonumber, with width 0 and two columns with LastName,FirstName. The
textboxes have deails on each record.
The form comes up with focus on the first record in the listbox and
the correct details in the text boxes. But if I click on another
line in the listbox, nothing happens the focus doesn't move and the
details remain those of the first entry.

If I press Enter then it moves to the next line in the listbox and the
details change correctly. If I add navigation buttons it also moves
correctly. Bound column is Column1, the ID.

Why doesn't simply clicking work ? I Haven't written any code for the
Listbox click event because I thought this was automatic.

What's wrong ?

Stuart

Sounds like you expect your ListBox to navigate the form to a record that
matches the selection made in the ListBox. ListBoxes and Comboboxes CAN be made
to do that, but it is not what they do "automatically". In addition, when a
ListBox or ComboBox is set up to perform form navigation it needs to be an
UNBOUND control (ControlSource is blank).

Please clarify what you expect to happen when you make a selecton and how you
expect it to happen.
 
S

Stuart Grant

Thanks Rick.

I wanted the data in the text boxes to show all the other fields in the
table for the selection in the list box. I had the list box set with the
query as the control source. I changed this to unbound. It them seemed
clear I would have to put some code in the listbox click event.

I had come across the way to synchronise somewhere using rsclone and
bookmark. With a bit of experimenting it worked.

Thank you for putting me on the right track

Stuart
 

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