open a file from MS Access form

  • Thread starter Thread starter sebastico
  • Start date Start date
S

sebastico

Hello Comm

I have a Form in MS Access. I use this Form to enter data in my in my
related data base. The key field is CodSig

On the other hand, I have a file in the path C:\Survey\Projs\BlqA.apr, which
has a field CodSig as well.

I would like a cmd button in my MS Access Form to open the BlqA.apr. Any
suggestion to code the cmd button is welcome.

Thanks
 
Hello Comm

I have a Form in MS Access. I use this Form to enter data in my in my
related data base. The key field is CodSig

On the other hand, I have a file in the path C:\Survey\Projs\BlqA.apr, which
has a field CodSig as well.

I would like a cmd button in my MS Access Form to open the BlqA.apr. Any
suggestion to code the cmd button is welcome.

Thanks

Your message is not as clear as you may think it is.
However, to open another file you can use:

Application.FollowHyperlink "C:\Survey\Projs\BlqA.apr"
 
Fred

Tanks. I apologyze for my message is not clear, but seems you got i.

I try your suggestion as follow

Private Sub Command51_Click()
On Error GoTo Err_Command51_Click

Dim Application FollowHyperlink As String

Application.FollowHyperlink = "C:\Survey\Projs\BlqA.apr"
Call Shell(stAppName, 1)

Exit_Command51_Click:
Exit Sub

Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click

End Sub

Nevertheless the Compile error : Syntax error is displayed. How can I fix
this.
 
Fred

Tanks. I apologyze for my message is not clear, but seems you got i.

I try your suggestion as follow

Private Sub Command51_Click()
On Error GoTo Err_Command51_Click

Dim Application FollowHyperlink As String

Application.FollowHyperlink = "C:\Survey\Projs\BlqA.apr"
Call Shell(stAppName, 1)

Exit_Command51_Click:
Exit Sub

Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click

End Sub

Nevertheless the Compile error : Syntax error is displayed. How can I fix
this.

You made it too complicated.
This is all you need:

Private Sub Command51_Click()
On Error GoTo Err_Command51_Click

Application.FollowHyperlink = "C:\Survey\Projs\BlqA.apr"

Exit_Command51_Click:
Exit Sub
Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click
End Sub
 
Back
Top