Checkbox response to formfield checkbox?

Hi All,

I have a VB form in a word document, when a command button is pressed i want the responses in the vb form to go onto another word document (not the one where the vb form is) i can get the command button to copy over the text strings onto a word form but i dont know how to do the checkboxes?

e.g. if chk_box 1 = true then word-doc bookmark checkbox 1 = true

any ideas?

Ive tried using activedocument but that doesnt seem to work as it still thinks im on the vbform document not the one thats been loaded up

Thanks in advance

Superblades
LVL 4
superbladesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

irudykCommented:
The value of the checkbox form field in the Word document can be set using something like the following:
ActiveDocument.FormFields("Check1").CheckBox.Value=chk_box 1
In your case change "Check1" to whatever the bookmark name of your checkbox is.
0
superbladesAuthor Commented:
That doesnt seem to work

'the requested member of the collection does not exist' i presume this is because its looking for the check1 in doc1 when its in doc2?

0
irudykCommented:
Yep, that would be the case. So maybe try using somehting like:
Documents("doc2").FormFields("Check1").CheckBox.Value=True
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

superbladesAuthor Commented:
Hi, This is my code, it still doesnt seem to work :S

Private Sub CmdPrintSum_Click()
 Dim wdApp As New Word.Application
    Dim wdDoc As Word.Document
Set wdDoc = wdApp.Documents.Open("h:\memberssummary.doc")
   wdApp.Visible = True
   With wdDoc.Bookmarks
      .Item("member_name").Range.Text = txt_name
      .Item("member_name1").Range.Text = txt_name
      .Item("member_name2").Range.Text = txt_name
      .Item("add_line1").Range.Text = txt_add1
      .Item("add_line2").Range.Text = txt_add2
      .Item("add_line3").Range.Text = txt_add3
      .Item("city").Range.Text = txt_city
      .Item("post_code").Range.Text = txt_postcode
      .Item("contact_telno").Range.Text = txt_telno
      .Item("contact_email").Range.Text = txt_email
      .Item("enddate").Range.Text = txt_officeend
      .Item("member_name1").Range.Text = txt_name
      .Item("member_name2").Range.Text = txt_name
      .Item("add_line1").Range.Text = txt_add1
      .Item("add_line2").Range.Text = txt_add2
      .Item("add_line3").Range.Text = txt_add3
      .Item("city").Range.Text = txt_city
      .Item("post_code").Range.Text = txt_postcode
      .Item("contact_telno").Range.Text = txt_telno
      .Item("contact_email").Range.Text = txt_email
      .Item("enddate").Range.Text = txt_officeend
      '.Item("check5").
      End With
      Documents("h:\memberssummary.doc").FormFields("Check5").CheckBox.Value = opt_disYes
     
   Set wdDoc = Nothing
   Set wdApp = Nothing

End Sub
0
irudykCommented:
Okay you are using the object wdDoc to reference the Word document, so replace
Documents("h:\memberssummary.doc").FormFields("Check5").CheckBox.Value = opt_disYes
with
wdDoc.FormFields("Check5").CheckBox.Value = opt_disYes
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
superbladesAuthor Commented:
Brilliant!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.