Hi,
I have been looking into transferring data from Excel to Access, I have now been able to successfully do this using a Macro, however the filename / location is static in the Macro.
How can I prompt the user to select the file, like in the Get External Data wizard?
Here is the Macro converted into VBA;
Many Thanks
Karl
I have been looking into transferring data from Excel to Access, I have now been able to successfully do this using a Macro, however the filename / location is static in the Macro.
How can I prompt the user to select the file, like in the Get External Data wizard?
Here is the Macro converted into VBA;
Code:
Function mac_Import_Excel()
On Error GoTo mac_Import_Excel_Err
DoCmd.TransferSpreadsheet acImport, 10, "tbl_Price_Requests", "C:\Users\KARL\Desktop\Copy of PPR Input Form V3.xls", True, "ENQ"
DoCmd.TransferSpreadsheet acImport, 10, "tbl_Price_Requests_Lines", "C:\Users\KARL\Desktop\Copy of PPR Input Form V3.xls", True, "LINES"
mac_Import_Excel_Exit:
Exit Function
mac_Import_Excel_Err:
MsgBox Error$
Resume mac_Import_Excel_Exit
End Function
Karl