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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ExportXML using WhereCondition does not work

Status
Not open for further replies.

0212

Technical User
Apr 2, 2003
115
0
0
US
Hello! I am having trouble exporting a specific record to XML. I would like to pass the Assignment No. from an open form to the report so that I filter and export only one record. I start with a Dialogue Box and enter an assignment no. I attached code to the dialogue OK Button that passes this information to a query which is the record source of the Form HSE MM POC and opens it. The query criteria for [Assignment No]request this information from the Dialogue Box. The specific record then is displayed in the Form HSE MM POC. On the Form HSE MM POC I have an XML Export Command Button. I have attached the below code.

Note that I have created a report that is identical to the form called Rpt HSE MM POC with the same record source as the form. However, the whereclause does not work. I get the query parameter window requesting the query criteria from the Dialogue Box. If I enter the assignment no, it will then export correctly. Again, I would like the assignment no to be passed to the report source query and only export one record.

Application.ExportXML _
ObjectType:=acExportReport, _
DataSource:="Rpt HSE MM POC", _
DataTarget:="Rpt HSE MM POC.xml", _
PresentationTarget:="Rpt HSE MM POC.xsl", _
WhereCondition:="Reports![Rpt HSE MM POC] _
[Assignment No]=" & "'" & Me![Assignment No] & "'"
I know this is long winded. Please let me know if you need additional information. Thanks for any help that you can give!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top