ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Linking checkboxes between userforms (https://www.excelbanter.com/excel-programming/357407-linking-checkboxes-between-userforms.html)

[email protected]

Linking checkboxes between userforms
 
Is there a way to link checkboxes between 2 different user forms (say
ckbCoast is in frmLocal and ckbSFR is in frmInfo)? Perhaps there's
Hide Me function that would keep one
user form open, just not shown on the screen giving the next form the
ability to link back to it. Any ideas?


Nigel

Linking checkboxes between userforms
 
Yes you can, but the two user forms must be loaded in memory. You can load
a userform and then hide it, or load with the hide method and it will be
loaded (if not already) and hidden.

The following code is behind userform1, which when it initialises, loads and
hides userform2. Changes to the checkbox1 on userform1 are 'copied' to
userform2 -checkbox1

Private Sub UserForm_Initialize()
UserForm2.Hide
End Sub

Private Sub CheckBox1_Click()
UserForm2.CheckBox1.Value = CheckBox1.Value
End Sub



--
Cheers
Nigel



wrote in message
oups.com...
Is there a way to link checkboxes between 2 different user forms (say
ckbCoast is in frmLocal and ckbSFR is in frmInfo)? Perhaps there's
Hide Me function that would keep one
user form open, just not shown on the screen giving the next form the
ability to link back to it. Any ideas?




[email protected]

Linking checkboxes between userforms
 
That makes sense, but would I have to create an actual CheckBox1 in
UserForm2? I'm looking for a solution that wouldn't require me to
duplicate a checkbox across the forms.



All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com