Hello every one Im totaly up the creek with out a paddle here. my mouth wrote a check my ass cant cash. I have a form made in access and i need it to output data to a word form that we submit to the FEMA. i dont know where i messed up i followed the tutorial here http://www.techrepublic.com/blog/mic...h-access-data/
From what i understand when i press the command button titled elevation forum it should open word and then open the file elevation-forum.doc and then fill in the information i listed in the "with" section of the vba code. it does none of this. lol here is the code i listed.
Code:
Private Sub cmdPrint_Click()
'Print customer slip for current customer.
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("C:\Users\Clint\Desktop\flood cert files\ELEVATION-FORM.doc", , True)
With doc
.FormFields("fldADDRESS").Result = Me!Address
.FormFields("fldCITY").Result = Me!City
.FormFields("fldSTATE").Result = Me!State
.FormFields("fldZIP").Result = Me!Zip
.FormFields("fldBFE").Result = Me!BFE
.FormFields("fldLAT").Result = Me!Lat
.FormFields("fldLONG").Result = Me!Lon
.Visible = True
.Activate
End With
Set doc = Nothing
Set appWord = Nothing
Exit Sub
errHandler:
MsgBox Err.Number & ": " & Err.Description
End Sub
Private Sub Command616_Click()
End Sub
any help would be great. Ill paypal someone if they can help me out here.