I have created a query OrderAllQuery from 3 related tables. One of the fields is a date field that has the same name in the original table and the query named OrdDate.
I have a simple sub to run the query and then run a report for a specific date range. OrdDate must fall within the range. The sub (see below) shows a 2465 on the Odate = line.
Can't see the problem. Any advice would be welcome
Private Sub cmdOrders_Click()
DoCmd.OpenQuery "OrderAllQuery"
Dim Odate As Date
Odate = [OrderAllQuery.OrdDate]
DoCmd.Close acQuery, "OrderAllQuery"
Call RunReport("Orders Report", Odate, Me.txtDateFrom, Me.txtDateTo)
End Sub
Odate = DLookup("[OrdDate]", "OrderAllQuery")