Is there a trick for passing date parameters to Access?
I have in a query in Access to look for dates "Between[Beginning Date] And [Ending Date]". This returns a recordset but the dates are way off.
Here is the Function.
Private Function Get_QueryDate(QName As String)
Dim Q As QueryDef
Dim db As Database
Dim rs As Recordset
Dim fromdate As Variant
Dim todate As Variant
Debug.Print QName
Debug.Print txtDateFrom.Text
Debug.Print txtDateTo.Text
fromdate = txtDateFrom.Text
todate = txtDateTo.Text
Set db = DBEngine.Workspaces(0).OpenDatabase(strDBname)
Set Q = db.QueryDefs(QName)
Q.Parameters("Beginning Date"
fromdate '4/30/00
Q.Parameters("Ending Date"
= todate '7/30/00
Set rs = Q.OpenRecordset()
Set frmMain.Data1.Recordset = rs
'Unload Me
End Function
I have in a query in Access to look for dates "Between[Beginning Date] And [Ending Date]". This returns a recordset but the dates are way off.
Here is the Function.
Private Function Get_QueryDate(QName As String)
Dim Q As QueryDef
Dim db As Database
Dim rs As Recordset
Dim fromdate As Variant
Dim todate As Variant
Debug.Print QName
Debug.Print txtDateFrom.Text
Debug.Print txtDateTo.Text
fromdate = txtDateFrom.Text
todate = txtDateTo.Text
Set db = DBEngine.Workspaces(0).OpenDatabase(strDBname)
Set Q = db.QueryDefs(QName)
Q.Parameters("Beginning Date"
Q.Parameters("Ending Date"
Set rs = Q.OpenRecordset()
Set frmMain.Data1.Recordset = rs
'Unload Me
End Function