I am using Access 2010.
I have 2 databases, one is the back end that is used to store all the data. The other as a front end which has forms for the user to interact with.
I wish to set up a form where the user clicks a button and prompts the user to select a file and the data will get imported into the back end database, which is not opened.
I am able to do import the file into the front end database, but need help getting to import to the back end.
I get this error on the DoCmd.TransferText line.
"Run-time error '438'. Object doesn't support this property or method."
Below is my code:
Private Sub cmdPSFT_Click()
Dim fd As Object
Dim txtDB As String
Dim strFile, strTable, strDir As String
Dim appAccess As Object
strDir = "Y:\Schedule F\"
strTable = "tblLedger"
txtDB = "Y:\Schedule_F\SchF Testing.accdb"
Set fd = Application.FileDialog(3)
Set appAccess = CreateObject("Access.Application")
.InitialFileName = strDir
.AllowMultiSelect = False
.Filters.Add "csv files", "*.csv", 1
strFile = .SelectedItems(1)
.Visible = False
.OpenCurrentDatabase txtDB, True
.DoCmdTransferText acImportDelim, "PSFT_Specs", _
strTable, strFile, True
Set fd = Nothing
Thanks for any help.