I want to import an XML file into an Access database. I have already exported the file and have got two files on my desktop which is where I exported them to. They are named "LOCALtblTEMPIHMGNotes.xsd
" and "LOCALtblTEMPIHMGNotes.xml
I currently browse for the import file via: (which works fine for an Excel file import but I want to change to XML)
Dim db As Database
Dim db2 As DAO.Database
Dim fd As FileDialog, SelectFolderOrFile
Dim rstMemberRunningNotes As DAO.Recordset
Dim rstTempFieldNotesImport As DAO.Recordset
Dim strIHMGNotesID As String
Dim strMemberID As String
Dim strRunningNote As String
Dim strSQL As String
' Dim NewTesttxtFile As String
Set db = CurrentDb
Set db2 = CurrentDb
If MsgBox("This function will update the selected record in the IHMG Notes table. Do you want to continue?", vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then
'This query deletes any existing records in tblTempFieldNotesImport
'This query deletes any existing records in tblTEMPORARY
'This code imports the selected Excel file into tblTempFieldNotesImport if the file name is different every time
Set fd = Application.FileDialog(msoFileDialogFilePicker)
.InitialFileName = Environ("userprofile") & "\Documents\"
If .Show Then
'This line of code is for an Excel formatted file...
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblTempFieldNotesImport", .SelectedItems(1), False, "A1:B66"
I do not have a clue as to how to change the code to allow me to browse for the XML file and proceed with the import of it into "tblTempFieldNotesImport"