Shell (1 Viewer)

kirsty

Registered User.
Local time
Today, 21:01
Joined
Nov 5, 1999
Messages
19
Hello again!

I am trying to open another database from a database on the on click event.

I have tried the following vb:-

Private Sub Command8_Click()

Dim RetVal
'Run new database
RetVal = Shell("S:\FINANCE\RISK\DATABASE\AVIATION.mdb", 1)

End Sub

However, this returns the runtime error 5 message / invalid call procedure.

Is this because I am trying to open an mdb with the shell function rather than an exe?

If so, does anyone know how to open another database from a command btn?

Thanks a lot,

Kirsty.
 

Travis

Registered User.
Local time
Today, 13:01
Joined
Dec 17, 1999
Messages
1,332
RetVal = Shell("C:\Program Files\MSOFFICE\MSACCESS.EXE" "S:\FINANCE\RISK\DATABASE\AVIATION.mdb", 1)
 

kirsty

Registered User.
Local time
Today, 21:01
Joined
Nov 5, 1999
Messages
19
I have tried using the vb code as specified by Travis (thanks for your reply!), however, it still doesn't work!

It is now saying file not found and I have checked and re-checked it to make sure it is correct.


Anymore suggestions?

Thanks a lot,
Kirsty.
 

KDg

Registered User.
Local time
Today, 21:01
Joined
Oct 28, 1999
Messages
181
what you need is

dim retVAL As Double
retVal = Shell("MSAccess S:\FINANCE\RISK\DATABASE\AVIATION.mdb", 1)

It will then find Access ( the application ) for you, you don't need the path




[This message has been edited by KDg (edited 02-14-2000).]
 

Users who are viewing this thread

Top Bottom