Hi,
I can't seem to find a bug in my program, thought maybe anyone has encountered this problem before.
I have two forms, both have the Microsoft Common Dialog box placed. The code I use to browse for the file is:
Me![opendlg].ShowOpen
path = Me![opendlg].FileName
Then I want to import that file to Access table
DoCmd.TransferSpreadsheet acImport, , "Temp", path, False, name2 & "!"
Same code is for both forms. On my first form it works fine, on the second form as it gets to import the file, I get a run-time error 3011 "The Microsoft Jet Database engine could not find the object "NameOfSelectedFile". Make sure the object exists and you spell its name and the path name correctly."
If anyone knows about the possible reasons for that, please let me know
I appreciate your help
Thanks.
I can't seem to find a bug in my program, thought maybe anyone has encountered this problem before.
I have two forms, both have the Microsoft Common Dialog box placed. The code I use to browse for the file is:
Me![opendlg].ShowOpen
path = Me![opendlg].FileName
Then I want to import that file to Access table
DoCmd.TransferSpreadsheet acImport, , "Temp", path, False, name2 & "!"
Same code is for both forms. On my first form it works fine, on the second form as it gets to import the file, I get a run-time error 3011 "The Microsoft Jet Database engine could not find the object "NameOfSelectedFile". Make sure the object exists and you spell its name and the path name correctly."
If anyone knows about the possible reasons for that, please let me know
I appreciate your help
Thanks.