Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2023, 06:23 PM
Fivestarnet@aol.com Fivestarnet@aol.com is offline UserForm Checkbox Feeds 2nd MSDOC Checkbox Windows 10 UserForm Checkbox Feeds 2nd MSDOC Checkbox Office 2016
Novice
UserForm Checkbox Feeds 2nd MSDOC Checkbox
 
Join Date: Sep 2023
Location: East and Central time zones
Posts: 1
Fivestarnet@aol.com is on a distinguished road
Default UserForm Checkbox Feeds 2nd MSDOC Checkbox

Title: Word 2016: VAB Checkbox: Display a variable of a UserForm CheckBox to another variable CheckBox inside the overlying Word Doc.

I have a Word Document that has 6 Checkboxes as 2 sets of 3 each to choose between. (i,e. yes/no and does/does not) Each set of the Checkboxes are verified to only have one box checked with the below code, as well as other fill in the form - text variables.

To simplify filling the document, I chose to "Create" a UserForm with 6 Checkboxes and other text data fields. Each 6 variables from the UserForm checkbox are assigned variable named Checkbox1 thru Checkbox 6.


Private Sub Checkbox1_Click()
If Checkbox1.Value = True Then
Checkbox2.Value = False
End If
End Sub
Private Sub Checkbox2_Click()


If Checkbox2.Value = True Then
Checkbox1.Value = False
End If
End Sub


Once all data is entered and boxes checked in the UserForm, the OK Button is pressed, which runs the VAB code to fill in the overlaying Word Document with all the variables including the selected Checkboxes1-6.

PROBLEM:
When the OK Button is clicked, All the text (which is assigned to various variables) BUT: None of the Checkbox are filled on the overlying Word Document.

Current Sample of many tries what I have tried, but the .Text can’t be changes to the correct VBA object type .Checkbox


Private Sub ToggleButtonOK_Click()

Dim COTTPower1 As Range
If Checkbox1 = True Then
Set COTTPower1 = ActiveDocument.Bookmarks(True).Range
Else
Set COTTPower1 = ActiveDocument.Bookmarks(False).Range
End If

COTTPower1.Text = Me.CheckBox1.Value
.
.
.
{Repeat of the checkbox VBA Coding with changing variables.}
.
.
.
End Sub


Can anyone help with the appropriate code to accomplish this task?
Reply With Quote
Reply

Tags
checkbox, checkboxvariables, tocheckbox



Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm Checkbox Feeds 2nd MSDOC Checkbox Code to reload userform checkbox value after unload mdr Word VBA 6 01-14-2022 09:30 AM
Checkbox - toggle hide/unhide other checkbox - XMLMapping GErl Word VBA 9 11-19-2020 03:15 PM
UserForm Checkbox Feeds 2nd MSDOC Checkbox Show Userform when Content Control CheckBox ticked derajlance Word VBA 1 05-13-2016 01:55 PM
UserForm Checkbox Feeds 2nd MSDOC Checkbox Checkbox in Userform lukael Excel Programming 5 02-18-2014 05:20 AM
UserForm Checkbox Feeds 2nd MSDOC Checkbox Checkbox on Userform result in Text in Word Dolfie_twee Word VBA 1 06-22-2010 07:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft