A
Andy Reed
I am calling zReport1 from Form1. The Report has the
following recordset code :-
Dim db1 As Database
Dim rs As Recordset
Dim qdf As QueryDef
Dim prm As Parameter
Set db1 = CurrentDb
Set qdf = db1.QueryDefs("Query1")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rs = qdf.OpenRecordset(dbOpenDynaset)
'''''
Query1 pulls back few fields from some tables and one of
the fields, a date format field, has the ctriteria :-
Between [Forms]![Form1].[Combo2] And [Forms]![Form1].
[Combo2]+6)
Combo2 on Form1 is a simple list of dates in date format.
The code above fails at :-
Set rs = qdf.OpenRecordset(dbOpenDynaset)
with an error about incompatible data types.
If I change the query criteria to Between Date() and Date
()+6 (i.e. using system clock rather than combo list) it
works OK
Any ideas?
following recordset code :-
Dim db1 As Database
Dim rs As Recordset
Dim qdf As QueryDef
Dim prm As Parameter
Set db1 = CurrentDb
Set qdf = db1.QueryDefs("Query1")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rs = qdf.OpenRecordset(dbOpenDynaset)
'''''
Query1 pulls back few fields from some tables and one of
the fields, a date format field, has the ctriteria :-
Between [Forms]![Form1].[Combo2] And [Forms]![Form1].
[Combo2]+6)
Combo2 on Form1 is a simple list of dates in date format.
The code above fails at :-
Set rs = qdf.OpenRecordset(dbOpenDynaset)
with an error about incompatible data types.
If I change the query criteria to Between Date() and Date
()+6 (i.e. using system clock rather than combo list) it
works OK
Any ideas?