Main Page | Report this Page
Computers Forum Index  »  Computer - Databases - MS Access  »  Access 2003 query for listbox sorts by Date but not...
Page 1 of 1    

Access 2003 query for listbox sorts by Date but not...

Author Message
RCGUA...
Posted: Mon Nov 02, 2009 5:03 pm
Guest
I have an Access 2003 Form with a listbox on it. The row source is a
Table/Query. The query sorts the records according a Date/Time field
in the table. The Date/Timefield is Short Date.

When I use the form and add a record to the list box, the code below
scrolls down the listbox to bottom and selects the last record. The
problem is that the last few records are sorted by the Date but not by
the Time. For example, if I have added five records today, the
listbox will show them in random order, except that all the records
entered today are on the bottom of the list.

first record added
third record added
fifth record added
second record added
fourth record added

== code that updates the list box ==

Me.lstEmployeePayments.SetFocus
Dim intListCount As Integer
intListCount = Me.lstEmployeePayments.ListCount
intListCount = intListCount - 1
Me.lstEmployeePayments.ListIndex = intListCount
 
 
Page 1 of 1    
All times are GMT
The time now is Mon Nov 23, 2009 2:43 pm