List Box go to first record

M

Martin

Hello,

I have two list boxes based, the second based on the results of the first.
This works fine. However, I want to automatically select the first record in
the second list box after the first one has been clicked on by the user. I
just cant think how to do this. Here is what I have on the click property of
the first list box:

Me.Refresh
DoCmd.GoToControl "List2"
'DoCmd.GoToRecord , , acFirst

Cananyone help?
 
M

Marshall Barton

Martin said:
I have two list boxes based, the second based on the results of the first.
This works fine. However, I want to automatically select the first record in
the second list box after the first one has been clicked on by the user. I
just cant think how to do this. Here is what I have on the click property of
the first list box:

Me.Refresh
DoCmd.GoToControl "List2"
'DoCmd.GoToRecord , , acFirst


Scrap that stuff an use list1's AfterUpdate event procedure:

Me.List2.Requery
Me.List2 = Me.List2.Itemdata(0)
 
M

Martin

Marsh, thanks for your help.

Martin

Marshall Barton said:
Scrap that stuff an use list1's AfterUpdate event procedure:

Me.List2.Requery
Me.List2 = Me.List2.Itemdata(0)
 

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