Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-13-2022, 08:28 AM
mdr mdr is offline Code to reload userform checkbox value after unload Windows 10 Code to reload userform checkbox value after unload Office 2019
Novice
Code to reload userform checkbox value after unload
 
Join Date: Jan 2022
Posts: 8
mdr is on a distinguished road
Default Code to reload userform checkbox value after unload

My apologies if I phrase this incorrectly, but I have self-taught myself some VBA based on threads here and on a few other forums.

I have a userbox that has textboxes that links to document variables and a checkbox named ChxMultiDef. When I unload the userform, I need a way to save the value of the checkbox so if I reopen the userform, the value of the checkbox comes back. I have found a way to do this for my textboxes/document variables, but not for the checkbox values.

This is what I do for the
For the textboxes/document variables, my code in the "OK" button is:


With ActiveDocument

.Variables("plaintiff").Value = Me.txtPlaintiff.Value

.Range.Fields.Update

End With
Unload me

AND my code in the Userform_initialize is:
With ActiveDocument
Me.txtPlaintiff.Value = .Variables("plaintiff").Value
End With
When I do this, when i unload the userform and then reload it, the textbox information is back. I just cannot figure out how to do the same with the checkbox.

Also, I cannot use the Me.Hide for a long reason that isn't necessary to explain here. And I don't want to save to the registry. When I have looked on excel forums, they seem to save to a hidden cell, but I don't think that works for Word.

Any advice would be greatly appreciated -- I've been pulling my hair out for days on this issue.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Word userform checkbox (checked/unchecked) is not saved on the Application Quit matapagi2019 Word VBA 3 03-31-2019 02:29 AM
Code to reload userform checkbox value after unload Show Userform when Content Control CheckBox ticked derajlance Word VBA 1 05-13-2016 01:55 PM
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
Code to reload userform checkbox value after unload Checkbox in Userform lukael Excel Programming 5 02-18-2014 05:20 AM
Code to reload userform checkbox value after unload 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:25 PM.


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