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
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