access 2002 vba exportXML method bug

J

jeff maultby

Hi
Found bug with ExportXML method when query is used to
populate form. Can anyone help with a fix please?

To reproduce please do the following:
Access 2002

Create new db

Create 2 simple master detail tables, use the wizards for
contacts &
orders, relate orders to contacts via contact id. Contact
tabel has ContactID, firstname, lastname. Orders table
has OrderID, ContactID, PurchaseOrderNumber.

Create 2 forms for each table, use the wizards.

Add command button to contact form. In command button
code add
"DoCmd.OpenForm Orders".

Add query named "Orders Query" with content of
SELECT Orders.OrderID, Orders.ContactID,
Orders.PurchaseOrderNumber
FROM Orders
WHERE Orders.ContactID=Forms!Contacts!ContactID;

In Record Source properties of Orders form select "Orders
Query".

Run Contacts form and see that orders form opens and
shows only those
orders for the current contact in the contact form.

Add command button to orders form labelled "Export XML"
and named
cmdExportXML.

In code for cmdExportXML button add
"Application.ExportXML
acExportForm, "Orders", "Orders.xml","Orders.xsd", "Orders
..xsl"

Run contacts form, click orders button, click Export XML
button and note
that a dialog opens asking for Forms!Contacts!ContactID

This does not happen with the form. Neither does it
happen with OutputTo
method which correctly generates XLS, RTF etc without
prompting.

I have a very small access 2002 mdb file which replicates
this problem, if u wish it please email me.

Jeff
 

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