How to open a file.

  • Thread starter spcscooter via AccessMonster.com
  • Start date
S

spcscooter via AccessMonster.com

I have an event that I need to use to open a file as well. Here is the code
and the file location is F:/MyExcel

Private Sub Command63_Click()

On Error GoTo Err_Command63_Click



Dim stDocName As String

Dim stLinkCriteria As String



stDocName = "CT2 Paperwork"

DoCmd.OpenForm stDocName, , , stLinkCriteria



Exit_Command63_Click:

Exit Sub



Err_Command63_Click:

MsgBox Err.Description

Resume Exit_Command63_Click



End Sub


Thank you for any help that you can give.

Scot
 
R

Ron2006

One simple way to open an established standard file:


Private Sub Command63_Click()
On Error GoTo Err_Command63_Click

Dim stDocName As String

stDocName = "F:/MyExcel/CT2 Paperwork.xls"

application.followhyperlink stDocName


' essentially, stDocName must be the
' fully qualified exact document name

Exit_Command63_Click:
Exit Sub

Err_Command63_Click:
MsgBox Err.Description
Resume Exit_Command63_Click
End Sub



Ron
 

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