Case 1
HTML
DoCmd.TransferText transfertype:=acImportHTML, _
TableName:=strTable, _
FileName:=strHTMLXMLFileAndPath, _
hasfieldnames:=TrueAssign the appropriate form as the subform’s source object.
Me![subNewJobs].SourceObject = “fsubNewJobs”Case 2
XML
ImportXML DataSource:=strHTMLXMLFileAndPath, _
importoptions:=acStructureAndData
DoCmd.SetWarnings FalseThere is no argument for specifying the name of the table that is
created when an XML file is imported; it comes in as the name
stored in the XML file (usually the XML file name), possibly with
a number added on.
DoCmd.Rename newname:=strTable, objecttype:=acTable, _
oldname:=strHTMLXMLFileAssign the appropriate form as the subform’s source object.
Me![subNewJobs].SourceObject = “fsubNewJobs”End SelectErrorHandlerExit:
Exit SubErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExitEnd SubExporting HTML and XML Files..............................................................................
If you want to experiment with exporting Access data to HTML or XML files, try the Export Job
Data to HTML or XML File form. If you select the “Export HTML or XML Data” option on the
main menu (see Figure 10.10) and click the button to its left, the Export Job Data to HTML or
Working with External Data 10