Setting list box value to first record in Query.

Mike-palmer

Registered User.
Local time
Today, 19:41
Joined
Mar 27, 2003
Messages
37
I have several List boxes populated with queries in my DVD database. These list boxes allow the selection of a particular DVD. I’d like to initialize the list box to the first record in the query so that particular DVD comes up automatically when the database opens (like when I click on the first entry in the list box).

How do I initialize the list box value to the DVDID of the first record of the query?
 
Use the "On Current" event of your form:

If IsNull(lstBox) Then
lstBox = lstBox.ItemData(0)
End If

Change "lstBox" to the actual name of your listbox.

HTH
RDH
 
Awesome, thanks VERY much. I've been puzzling over this for a while and it's wonderful to see such a simple and straightforward answer.
 

Users who are viewing this thread

Back
Top Bottom