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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RE:FAQ705-1971. a Word/Excel/Picture/Any Other File from Access?

Status
Not open for further replies.

dkape

MIS
Mar 22, 2001
17
0
0
US
I'm trying to use the code from this faq to allow users to open external files from a form.

In the code on the form I've tried two different bits of code, neither work the way I'd hoped.

One is:

DoCmd.OpenStoredProcedure (fHandleFile("c:\test.txt", WIN_NORMAL))

Which opens the file, but also pops up a message box saying "Access can't find the object '-1'.

The second is:
Print fHandleFile("c:\test.txt", WIN_NORMAL)

Which opens the file, but also pops up a message box saying "Object doesn't support this property or method."

Has anyone one successfully used the code supplied in this FAQ? If so, could they offer some ideas on what I'm doing wrong?

Thanks, Doug
 
Did you try to turn warnings off before running your code?

Code:
DoCmd.SetWarnings False

'...your code

DoCmd.SetWarnings True
VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Doug,
I answered your FAQ comment to your email address, but for anyone else reading:

all you need to do is call the function. Just:

fHandleFile "c:\test.txt", WIN_NORMAL

will do it. Notice the lack of brackets.

HTH

Ben

BTW: I'm back! Been away from the forum for a few weeks, too much real work to spend time here, but things are a little easier now! (Famous last words!!) ----------------------------------------
Ben O'Hara
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top