Dlookup in report Outputname string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to export a report with a dlookup in the outputname string.

strOutputName = "\\L:\Daily Reports\Brokerage Comb Report " & DLookup("[End
Date]", "Daily Criteria") & ".rtf"

The following error message appears when the report is exported:

Microsoft Office Access can't save the output data to the file you've
selected.

The export works if the dlookup is removed. Any ideas what might be wrong
with the code?

Thanks,
Melanie
 
The date field has / chr in it, and that is a problem for a file name, try
this instead

strOutputName = "\\L:\Daily Reports\Brokerage Comb Report " &
format(DLookup("[End Date]", "Daily Criteria"),"ddmmyyyy") & ".rtf"
 
Thanks. Worked great!

Melanie

Ofer said:
The date field has / chr in it, and that is a problem for a file name, try
this instead

strOutputName = "\\L:\Daily Reports\Brokerage Comb Report " &
format(DLookup("[End Date]", "Daily Criteria"),"ddmmyyyy") & ".rtf"


Melanie O said:
I am trying to export a report with a dlookup in the outputname string.

strOutputName = "\\L:\Daily Reports\Brokerage Comb Report " & DLookup("[End
Date]", "Daily Criteria") & ".rtf"

The following error message appears when the report is exported:

Microsoft Office Access can't save the output data to the file you've
selected.

The export works if the dlookup is removed. Any ideas what might be wrong
with the code?

Thanks,
Melanie
 

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

Back
Top