Hello,
I have the following code that lets the user read in a text file and backs up the table and then addes the data to the main table and then removes the imported temp table, works great on my xp computer using access 2003, tried it on my laptop running win7 and access 2003 and it comes up with a Active X component cant create object 429 error, Please advise on how to fix this:
Dim fd As FileDialog
'Opens dialog box for file selection
Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
'Sets Type of file to look for
ObjFSO.Filter = "VBScripts|*.vbs|Text Documents|*.txt|All Files|*.*"
ObjFSO.FilterIndex = 3
'Sets Directory for initial search to start in
ObjFSO.InitialDir = "C:\Windows\Temp\"
If fld.Show = True Then
DoCmd.CopyObject , "Sales_download_file_ao_copy", acTable, "Sales_download_file_ao"
'Transfers file using acImportDelim profile previously set through manually importing into table
DoCmd.TransferText acImportDelim, "Sales_download_file_ao Import Specification", "Imported", ObjFSO.Filename, True
DoCmd.OpenQuery "Imported Query", , acReadOnly
DoCmd.OpenQuery "Imported Query Bad Dates", , acReadOnly
MsgBox " Completed"
DoCmd.DeleteObject acTable, "Imported"
End If
I have the following code that lets the user read in a text file and backs up the table and then addes the data to the main table and then removes the imported temp table, works great on my xp computer using access 2003, tried it on my laptop running win7 and access 2003 and it comes up with a Active X component cant create object 429 error, Please advise on how to fix this:
Dim fd As FileDialog
'Opens dialog box for file selection
Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
'Sets Type of file to look for
ObjFSO.Filter = "VBScripts|*.vbs|Text Documents|*.txt|All Files|*.*"
ObjFSO.FilterIndex = 3
'Sets Directory for initial search to start in
ObjFSO.InitialDir = "C:\Windows\Temp\"
If fld.Show = True Then
DoCmd.CopyObject , "Sales_download_file_ao_copy", acTable, "Sales_download_file_ao"
'Transfers file using acImportDelim profile previously set through manually importing into table
DoCmd.TransferText acImportDelim, "Sales_download_file_ao Import Specification", "Imported", ObjFSO.Filename, True
DoCmd.OpenQuery "Imported Query", , acReadOnly
DoCmd.OpenQuery "Imported Query Bad Dates", , acReadOnly
MsgBox " Completed"
DoCmd.DeleteObject acTable, "Imported"
End If