Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Common Dialog box problem

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
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.
 
Have you placed a breakpoint on the TransferSpreadsheet command to see exactly what the values are in the immediate window? Try troubleshooting your problem with the debugger and the immediate window. It's important you know the values the function is using.

-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top