Output To

A

ant1983

Hi,

Here's my code:

Private Sub Command4_Click()

DoCmd.OutputTo acOutputQuery, qryBillingExport, ,
([Forms]![frmBillingExportFrom]![dateCollectionDate])

End Sub

Brings up an error.

What i want to do is have the filename that it will be saved as to be my
dateCollectionDate's value
 
A

ant1983

Sorry, i meant my code is:

Private Sub Command4_Click()

Dim stDocName As String

stDocName = "qryBillingExport"

DoCmd.OutputTo acOutputQuery, stDocName, ,
([Forms]![frmBillingExportFrom]![dateCollectionDate])

End Sub
 
J

Jim Burke in Novi

If 'dateCollectionDate' has a valid filename, I'm pretty sure that should
work. My guess is the value it contains isn't a valid Windows filename. It
needs to be fully qualified, e.g. C:\DirName\FileName. Check the value of the
dateCollectionDate field in debug mode and see if it looks OK. You don't want
parentheses around the fiename - if you have that in your code that could be
the problem.
 

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