View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Sam Sam is offline
external usenet poster
 
Posts: 68
Default HELP: Error! No document variable supplied

Hi All,

I have created a button in access form that exports certain details from the
form to a word template. But when exporting textfields that has no values (on
access form) displays an error:
Error! No document variable supplied.

Here is my code to resolve this issue but it's not working.

With doc
..variables("Name").Value = Nz((Name.Value), "")
..variables("Address").Value = Nz(Address.Value, "")
..variables("City").Value = !Nz(Me.City.Value, "")

..Fields.Update
End With

Thanks in advance