ChrisCione
Board Regular
- Joined
- Aug 27, 2008
- Messages
- 92
- Office Version
- 365
- Platform
- Windows
I have a command button on my form which allows me to export Access fields to corresponding fields in a Word fillable form. It works perfectly except for a memo field that I use. The character count in the memo field is usually pretty high (in the thousands, i'm sure). I've done research and have learned that Access usually will truncate the data, however, mine's not showing at all. I've tripled checked that the field name in Access and the field name in Word are correct, and I've checked that the field in Word is set to unlimited text. But it won't export the data at all.
Does anyone have suggestions (the solutions I've found are relative to Excel)?
By the way, here's the code, if needed:
Private Sub CommandERSRGB_Click()
Dim appWord As Word.Application
Dim doc As Word.Document
'Avoid error 429, when Word isn’t open.
On Error Resume Next
Err.Clear
'Set appWord object variable to running instance of Word.
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'If Word isn’t open, create a new instance of Word.
Set appWord = New Word.Application
End If
Set doc = appWord.Documents.Open("L:\Bper Spec\Cione\Database Files\Announcement (ERS Rep GridBased).doc", , True)
With doc
.FormFields("Duties").Result = Me!Duties
.Visible = True
.Activate
End With
Set doc = Nothing
Set appWord = Nothing
Exit Sub
errHandler:
MsgBox Err.Number & ": " & Err.Description
End Sub
The code just shows one field "Duties"; there are actually several others.
Does anyone have suggestions (the solutions I've found are relative to Excel)?
By the way, here's the code, if needed:
Private Sub CommandERSRGB_Click()
Dim appWord As Word.Application
Dim doc As Word.Document
'Avoid error 429, when Word isn’t open.
On Error Resume Next
Err.Clear
'Set appWord object variable to running instance of Word.
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'If Word isn’t open, create a new instance of Word.
Set appWord = New Word.Application
End If
Set doc = appWord.Documents.Open("L:\Bper Spec\Cione\Database Files\Announcement (ERS Rep GridBased).doc", , True)
With doc
.FormFields("Duties").Result = Me!Duties
.Visible = True
.Activate
End With
Set doc = Nothing
Set appWord = Nothing
Exit Sub
errHandler:
MsgBox Err.Number & ": " & Err.Description
End Sub
The code just shows one field "Duties"; there are actually several others.