Hello,
I am using Shell to execute files on the click of an Access button on a form. In the code below Me.filename is the value from a control on the form which is the file name and extension. It is generated and saved in the same folder as the mdb file so CurrentProject.Path completes the full path name.
A major problem I have is that this will open the vbscript file msgbox.vbs
Shell "cscript ""C:\Documents and Settings\mypc\\msgbox.vbs"""
But I need to replace the path name with the variable file like below and just can’t get it to work.
Dim file As String
file = CurrentProject.Path & "\" & Me.filename
Call Shell("cscript.exe " & file, vbNormalFocus)
Any help will be much appreciated.
I am using Shell to execute files on the click of an Access button on a form. In the code below Me.filename is the value from a control on the form which is the file name and extension. It is generated and saved in the same folder as the mdb file so CurrentProject.Path completes the full path name.
A major problem I have is that this will open the vbscript file msgbox.vbs
Shell "cscript ""C:\Documents and Settings\mypc\\msgbox.vbs"""
But I need to replace the path name with the variable file like below and just can’t get it to work.
Dim file As String
file = CurrentProject.Path & "\" & Me.filename
Call Shell("cscript.exe " & file, vbNormalFocus)
Any help will be much appreciated.