R
RCGUA
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
=== this is also posted in ( comp . databases . ms-access ), ===
sorry for the cross posting but I accidentally posted in there and
there was no response, I meant to post it in this group
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
=== this is also posted in ( comp . databases . ms-access ), ===
sorry for the cross posting but I accidentally posted in there and
there was no response, I meant to post it in this group