ExportXML

L

Leslie

I am having problems trying to use the ExportXML function. The following is
my code, but when I try to run from the immediate window, I get a compile
error. I did not get any message when I compiled. Anyone know what is wrong
here? ...and thanks!

The message I get when I run from immediate window is:
"Compile error: Argument not optional"

Immediate Window:
ExportQuery 'HuntGroups', "c:\lesliero\documents\", 'HuntGroups.xml'

Code:
Public Sub ExportQuery(strSource As String, strPath As String, strTarget As
String)
On Error GoTo Err_ExportQuery

Access.Application.ExportXML acExportQuery, strSource, strPath & strTarget

Exit_ExportQuery:
Exit Sub
Err_ExportQuery:
Call LogError(Err.Number, Err.Description, "'" & conMod & "'" & " -
ExportQuery()")
MsgBox prompt:="Error Number: " & Err.Number & vbCrLf _
& Err.Description, _
buttons:=vbCritical + vbMsgBoxHelpButton, _
Title:="Error!", _
HelpFile:=Err.HelpFile, _
context:=Err.HelpContext
Resume Exit_ExportQuery
End Sub
 
L

Leslie

Thank you. I thought I had already tried that, but I guess not because it
worked. The sample code, taken from Business Solutions Access 2007 VBA book,
used single ' marks around the source, which is why I used the single vs
double.

Thanks again for your help.

Leslie
 

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

Top