Export form that is not bound to table

K

kfguardian

I was able to export to a file with the office links or export menu items
when my form was linked to a table. I am now doing ADO connection and when I
export, the record I am on is just duplicated for the number of records that
exist (so if there are two records, both rows in excel have the same data).
I would use the export query, but I am having a hard time figuring out how to
give my sql query a name to reference it in any commands?! What would you
suggest??

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top