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