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" wrote:
> 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
|