I have a recordset of payments made for attending an Event. Typically these are a deposit, a staged payment and a final payment. The payments are displayed in a form and there are Next and Previous buttons to scroll through the payments in date of payment order.
The form fJDWEventPay is called from the form fJDWBookings with the following code snippet.
In Form_Load of fJDWEventPay I set on a filter with the passed argument - as follows:
Me.Filter = "jdwp_BookingRef = " & Me.OpenArgs
Me.FilterOn = True
and I set the order - as follows:
Me.OrderBy = "jdwp_Date"
Me.OrderByOn = True
... but the first payment record to display is not always the first record by date - it's the second or third (appears to be entirely random).
I have tried setting the order and then the filter but it makes no difference
Any ideas anybody?
Dim lngNoBookings as Long
Dim stDocName As String
lngNoBookings = DCount("*", "tJDWBookings", "jdwb_Event=" & lngEventID & " And jdwb_BookingID=" & lngBookingID & " and jdwb_Status=" & Chr(34) & strStatus & Chr(34))
If lngNoBookings > 0 Then
stDocName = "fJDWEventPay"
DoCmd.OpenForm stDocName, , , , , acDialog, lngBookingID ' pass Open Args
MsGBox "No Bookings ... " 'etc