open a file from MS Access form

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
 
F

fredg

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"
 
S

sebastico

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.
 
F

fredg

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
 

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