set combobox row pointer

Keith Nichols

Registered User.
Local time
Today, 17:31
Joined
Jan 27, 2006
Messages
431
I have a combobox that may be used a number of times. It is populated by a query in VBA using rowsource = SQLText & WClause etc which sorts it in a particular fashion.

Currently, when a user clicks the drop down list, the last selected record is at the top of the list and if the user wants to select an item from higher up they must use the scroll bar.

Is there any easy way to set the pointer to the first record showing?

Regards,
 
Yes, you can set the value of the control to the value of the first member of the .ItemData property of the control, which functions as an array of bound column values. Code looks like...

Code:
Me.cboMyCombo = Me.cboMyCombo.ItemData(0)
 
Many thanks Lagbolt

Thanks Lagbolt - works a treat.

It took me a couple of days to work this out as I was modifying a whole host of other things at the same time, most of which didn't work first time out!:)

BTW, is this you:

Lag screw, lag bolt or coach screw refers to a large wood screw with a hexagonal head, driven by a wrench rather than a screwdriver.

Regards,

Keith.
 
Cheers Keith:
And yes, in repect to your fastener description: You've hit the nail on the head.
 

Users who are viewing this thread

Back
Top Bottom