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!

I am trying to pass 2 parameters in a sub routine

Status
Not open for further replies.

lewie

Technical User
Jan 17, 2003
94
US
I have the following code:
Public Sub ExportADOXML(strTableName As String, f As String)
' Export the specified table as XML, using the
' ADO XML format rather than native Access format
Dim rst As ADODB.Recordset

On Error GoTo HandleErr
Stop
Set rst = New ADODB.Recordset
rst.Open strTableName, CurrentProject.Connection
rst.Save f, adPersistXML

rst.Close
Set rst = Nothing

ExitHere:
Exit Sub

HandleErr:
MsgBox Err.Number & ": " & Err.Description, vbCritical, _
"ExportADOXML"
Resume ExitHere

End Sub
I test it in immediate window like ExportADOXML("tblCompany", "Lew") and it keeps bombing saying "Compile error expected = "
Please Help!
TIA
Lewie
 
Get rid of the parens, like this:
ExportADOXML "tblCompany", "Lew"
Or use the CALL instruction, like this:
Call ExportADOXML("tblCompany", "Lew")

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