Help Export VB code not working

C

Chase

Below is the code I am attempting to use to create a query to export to excel
from 2 text boxes in a form

Dim StrPath As String
Dim StrWkPkg As String

StrWkPkg = ("qsel" & Forms![frmPjtReport]![txtWkPkg] & "" &
Forms![frmPjtReport]![txtSection])
StrPath = "C:\XWork\Output\" & txtFileName & ".xls"
DoCmd.CopyObject "ProcessPmtRpt.mdb", StrWkPkg, acQuery, "qselWkPkgCon"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, StrWkPkg,
StrPath, True
DoCmd.DeleteObject acQuery, SteWkPkg
 

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