link to word no longer working

K

KateB

I wonder if anyone could help with this. My colleague has a database that
was created by someone who has since left. In it she has a free text box
that she says she types into, and then clicks a button which used to open
Word so that she could save it or continue typing. However, since having a
new computer with Access 2003 this button now gives an error back to the VBA
code. I will post it below - can anyone see what is wrong? I've never used
the database and my colleague is a front-end user only, so any help of how to
proceed would be greatly appreciated.

Private Sub Command146_Click()
On Error GoTo err_command146_click

Dim incpk
Dim incsummary
Dim filepath

filepath = "I:\incidents\incidentdb\detail\"

pklen = 6 - Len(Me.IncidentPK)
incpkdesc = "IN"
For a = 1 To pklen
incpkdesc = incpkdesc & "0"
Next a
incpkdesc = incpkdesc & Me.IncidentPK
incpk = Me.IncidentPK
incsummary = Me.SummaryDesc

Dim wordapp As Word.Application
Dim worddoc As Word.Document
Set wordapp = New Word.Application

With wordapp
.Visible = True
Set worddoc = .Documents.Open(filepath & incpk & ".doc", , False)
End With

exit_Command146_click:
Exit Sub
 
P

Paolo

Hi KateB,
what is the error raised and which line of your code is highlighted when it
happens?
You say you changed the pc so it could be a reference problem. Try to check
the references and see if someone say missing.

HTH Paolo
 

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