S
spenn
Can u help me ? look at the last to post messages. I am using Microsoft
Access 2003
Access 2003
Dirk Goldgar said:spenn said:Thanks for all the help but I have another problem
here is the code:
Public Sub outputreport()
'DoCmd.OutputTo acOutputReport, "Dataards Report", acFormatSNP,
CurrentProject.Path
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("DATACARD FORM SORT")
With rs
Do Until .EOF
DoCmd.OpenReport "Datacards Report", acViewPreview, , _
"[Datacard Title]=" & _
Chr(34) & ![Datacard Title] & Chr(34)
'DoCmd.OpenReport "Datacards Report", acViewPreview, , _
"Datacard Title=" & ![Datacard Title]
DoCmd.OutputTo acOutputReport, "Datacards Report",
acFormatSNP, _ "C:\Documents and
Settings\Owner\Desktop\New Folder" & ![Datacard Title] & ".snp"
DoCmd.Close acReport, "Datacard Report", acSaveNo
.MoveNext
Loop
.Close
End With
End Sub
the error says: The OutputTo action was canceled.
the screen comes up and says out puting then the error message comes
up. can u help me
thanks
A simplified version of that code works for me. Two things occur to me.
First, I think you need a back-slash on the end of the folder path when
you build your output file name, like this:
"C:\Documents and Settings\Owner\Desktop\New Folder\"
& ![Datacard Title] & ".snp"
Second, have you inspected the values of [Datacard Title] to make sure
that they are all valid for file names? There are characters that a
Windows file name cannot contain.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)