Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error, Expected List Seperator or )

Status
Not open for further replies.

bblekfeld

Programmer
Mar 9, 2004
49
US
I am trying to call the following function from the immediate window by typing"

SaveAllAsText(J:\Shared\Orders)


Anyone have any idea why this might give me

"Compile Error, Expected, List Seperator or ) "


The Code was taken from this post






Public Function SaveAllAsText(sPath)
Dim vObject, i, dbs
Set dbs = CurrentDb
For Each vObject In dbs.Containers("Forms").Documents
SaveAsText acForm, vObject.Name, sPath & "\" & vObject.Name & ".xcf"
Next
For Each vObject In dbs.Containers("Reports").Documents
SaveAsText acReport, vObject.Name, sPath & "\" & vObject.Name & ".xcr"
Next
For Each vObject In dbs.Containers("Modules").Documents
SaveAsText acModule, vObject.Name, sPath & "\" & vObject.Name & ".xcm"
Next
For Each vObject In dbs.Containers("Scripts").Documents
SaveAsText acMacro, vObject.Name, sPath & "\" & vObject.Name & ".xcs"
Next
For i = 0 To dbs.QueryDefs.Count - 1
If Left(dbs.QueryDefs(i).Name, 4) <> "~sq_" Then
Application.SaveAsText acQuery, dbs.QueryDefs(i).Name, sPath & "\" & dbs.QueryDefs(i).Name & ".xcq"
End If
Next i
Debug.Print "All done"
End Function
 
Where is that meant to be placed?

I tried putting that in the module and then typing x but it didnt' work
 
In the immediate windows, type this:
SaveAllAsText "J:\Shared\Orders"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top