Need VBcode to open msPaint from Access 2007

C

Citipool

Does anyone have VB code that I could use to have the option of clicking on
cmd button in a form to open msPaint? Thank you :)
 
C

Citipool

Thanks Arvin. I have to admit that I am learning my way up the ladder when it
comes to VB. I've added the code you suggested but I get an error
message:"The expression On click you enetered as the event property setting
produced the following error: Invalid outside procedure." Umm, now what?
any insight?
 
D

David W. Fenton

I have to admit that I am learning my way up the ladder when it
comes to VB. I've added the code you suggested but I get an error
message:"The expression On click you enetered as the event
property setting produced the following error: Invalid outside
procedure." Umm, now what? any insight?

More information needed.

Where did you put the code?

Which line is producing the error?
 
D

Douglas J. Steele

You sure about that, Arvin? Isn't the ShellExecute API intended to open a
file in the appropriate application based on its extension? In other words,
Call fHandleFile("C:\Folder\File.doc", WIN_NORMAL) would open File.doc in
Word.

In this case, I'd forgo the API and simply use

Private Sub cmdPaint_Click()
Shell "C:\Windows\System32\mspaint.exe", vbNormalFocus
End Sub


--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top