K
kfguardian
I need to create a name for my SQL query so I can export my query to excel.
However, VB isn't recognizing the type "querydef"- ie doesn't like "As
querydef." I have yet to find anywhere where this is "user defined"???
Please help!
My ultimate goal is to export the records from an ado recordset that are
pulled into a form with this query. I tried just to use export and office
links but without linking the form to the table, I just get duplicates of the
current record (ie if there are 4 records after query, excel shows 4 rows all
with the same data).
I don't care which way it gets done at this point- I would just like to be
done with this part... it was supposed to be quick and easy?!
Set cnThisConnect = CurrentProject.Connection
strSQL = "SELECT * FROM tblInputData " _
& "WHERE (InputDate >= CONVERT(DATETIME, '" & datQueryStart
& "', 102)) AND" _
& " (InputDate < CONVERT(DATETIME, '" & ShiftEnd &
"', 102))"
rstNewInputData.Open strSQL, cnThisConnect, adOpenKeyset,
adLockOptimistic, adCmdText
However, VB isn't recognizing the type "querydef"- ie doesn't like "As
querydef." I have yet to find anywhere where this is "user defined"???
Please help!
My ultimate goal is to export the records from an ado recordset that are
pulled into a form with this query. I tried just to use export and office
links but without linking the form to the table, I just get duplicates of the
current record (ie if there are 4 records after query, excel shows 4 rows all
with the same data).
I don't care which way it gets done at this point- I would just like to be
done with this part... it was supposed to be quick and easy?!
Set cnThisConnect = CurrentProject.Connection
strSQL = "SELECT * FROM tblInputData " _
& "WHERE (InputDate >= CONVERT(DATETIME, '" & datQueryStart
& "', 102)) AND" _
& " (InputDate < CONVERT(DATETIME, '" & ShiftEnd &
"', 102))"
rstNewInputData.Open strSQL, cnThisConnect, adOpenKeyset,
adLockOptimistic, adCmdText