G
Guest
Here's the code:
Dim rsHeader As DAO.Recordset
Set rsHeader = CurrentDb.OpenRecordset("HeaderSelect", dbOpenSnapshot)
Here is a simplified version of the parameter in the HeaderSelect query:
I can run the query directly just fine, and it correctly prompts me for
DateFrom. However, when I run VBA to open the recordset, it fails with error
0. When I replace DateFrom with >#5/1/2006# in the query, the recordset opens
fine from VBA.
Ultimately, the parameter will be this:
Between [Forms]![Main]![DateFrom] and [Forms]![Main]![DateTo]
so that the user will select the date range on the form. Again, the query
runs fine alone, but the attempt to open the recordset fails.
Dim rsHeader As DAO.Recordset
Set rsHeader = CurrentDb.OpenRecordset("HeaderSelect", dbOpenSnapshot)
Here is a simplified version of the parameter in the HeaderSelect query:
[DateFrom]
I can run the query directly just fine, and it correctly prompts me for
DateFrom. However, when I run VBA to open the recordset, it fails with error
0. When I replace DateFrom with >#5/1/2006# in the query, the recordset opens
fine from VBA.
Ultimately, the parameter will be this:
Between [Forms]![Main]![DateFrom] and [Forms]![Main]![DateTo]
so that the user will select the date range on the form. Again, the query
runs fine alone, but the attempt to open the recordset fails.