Re: ExportXML

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

"Alex Dybenko" wrote:

Hi,
you have to put string arguments in double quotes, try:

ExportQuery "HuntGroups", "c:\lesliero\documents\", "HuntGroups.xml"


--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

"Leslie" <Leslie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:36C09A58-F915-415E-9795-7FB5144B4A8A@xxxxxxxxxxxxxxxx
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

.



Relevant Pages

  • Re: ExportXML
    ... The message I get when I run from immediate window is: ... "Compile error: Argument not optional" ... Public Sub ExportQuery(strSource As String, strPath As String, strTarget As ...
    (microsoft.public.access.modulesdaovba)
  • ExportXML
    ... I am having problems trying to use the ExportXML function. ... The message I get when I run from immediate window is: ... "Compile error: Argument not optional" ... Public Sub ExportQuery(strSource As String, strPath As String, strTarget As ...
    (microsoft.public.access.modulesdaovba)
  • Re: Whats right with FORTH and wrong with c.l.f.
    ... I doubt anyone would claim string handling as a Forth forte. ... parsing data in ASCII format *is* a Forth forte. ... Most likely a Forth programmer will happily hardcode a special purpose ... sample code, or at least the very little sing of code usage. ...
    (comp.lang.forth)
  • Re: If value is in a list
    ... there an easier or more efficient way, than the sample code below, to ... depending on the JavaScript implementation. ... If the list is a String of separated numbers, ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)
  • Re: How can I programmatically relink OLEs in a Word document?
    ... I was told that the sample code in your response applies to shapes and I ... For generating from the old sourcefullname ... The slot for string processing is below: ... Dim strLink As String ...
    (microsoft.public.word.vba.general)