Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Select 1st Record in List Box

Status
Not open for further replies.

Jamie2002

Technical User
Joined
Sep 17, 2001
Messages
62
Location
GB
I'm using 4 list boxes whose data all depend on the previous ones selection by using queries and when each one is updated the rest of them all refresh to show the available selections.

For eg Listbox 1 contains values "Horse Racing", "Football" & "Other Sports".

If you select "Football" the 2nd listbox displays "Football" & "Live Football".

If you select "Live Football" the 3rd listbox displays all the Live Football matches for the week with associated figures.

What I need to be able to do is that when I select say "Live Football" out of list box 2 how do I write code to make access auto select the 1st record in list box 3 just so the boxes are never left in limbo waiting for a particular selection.

I'm sure this is simple........if you know how.

Thanks.

Jamie. Thanks

Jamie
 
In the same piece of code where you set ListBox.RowSource = srtSQL ( ListBox_AfterUpdate presumably ) you then follow it with:-
NextListbox.Selected(0) = True

Rem Selected is a 0 based collection ( 1st row = 0, 2nd row = 1 Etc. )



'ope-that-'elps

G LS
 
The way I have structured this is to have a table with 4 fields which relate to each list box, these 4 fields each link to 4 seperate queries which then filter the data which is then available in the next listbox.

When one list box is updated the code requerys all the others and then refreshes the form.

Is there an easier way to do this...?

As well the requerying takes about 10-15 seconds which is not ideal.

Thanks Thanks

Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top