I have a select query with the following as criterion for a date field:
A second query performs agregate sums on the first query. The query works fine if I run it using the access user interface, but fails from within VB code!
I get "run time error 3061 - too few parameters. Expected 2."
If I delete the date criterion, or change it with hardwired #dates#, it works fine. What am I doing wrong?
Cheers,
Tim Morris
tim.morris@utas.edu.au
[sig][/sig]
Code:
Between [Forms]![myForm]![StartDate] And [Forms]![myForm]![EndDate]
Code:
Set dbs = CurrentDB
Set rec = dbs.OpenRecordset("myAggregateQuery", dbOpenSnapshot)
If I delete the date criterion, or change it with hardwired #dates#, it works fine. What am I doing wrong?
Cheers,
Tim Morris
tim.morris@utas.edu.au
[sig][/sig]