![]() |
XL2002 - Resetting Checkbox values on Multipage Form
I have a userform that contains a multipage control. Page1 of the multipage
control contains 5 checkboxes (numbered 2 to 6). I'm trying to reset the checkbox values to false before the form is activated but can't do it using a loop. Can you shed some light on the issue? (code below) Also, once the form is active I'd like to update a textbox everytime one of the checkboxes is clicked. I've currently set up a click event for each checkbox but seems a bit cumbersome. Is there a better way to do it, perhaps with a groupname or frame control? Thanks - Trevor -------------------------------------------------------------------------------- With UserForm1 .CheckBox1 = True .TextBox1.Value = Sheets("Customer").Range("C5").Value .TextBox2.Value = Format(Sheets("Customer").Range("F43"), "£0,00") For i = 2 To 6 .MultiPage1.Pages(1).CheckBox(i) = False Next i .MultiPage1.Pages(1).TextBox13.Value = Format(Sheets("Customer").Range("L24").Value, "£0,00") .Show End With |
XL2002 - Resetting Checkbox values on Multipage Form
Change: .MultiPage1.Pages(1).CheckBox(i) = False
To: .Controls("CheckBox" & i) = False Regarding the 2nd question, maybe you can send each Checkbox_Click event to one common Sub. But it's impossible to say w/o knowing what each one does. Hth, Merjet |
XL2002 - Resetting Checkbox values on Multipage Form
Hi Merjet - Thanks for your help.
All the checkboxes do, once they are clicked, is update a value on a sheet and then add that value to a textbox on the form. Me.MultiPage1.Pages(1).TextBox13.Value = Format(Sheets("Customer").Range("L24").Value, "£0,00") Although this only begins to work once a check box is clicked twice (not a doubleclick). My textbox is set to £0,00 when the form activates. Setting a checkbox to TRUE should then change the textbox to a new value e.g £500. But it only updates the textbox once the checkbox is set to FALSE - which is obviously wrong. Any suggestions? Trevor "merjet" wrote: Change: .MultiPage1.Pages(1).CheckBox(i) = False To: .Controls("CheckBox" & i) = False Regarding the 2nd question, maybe you can send each Checkbox_Click event to one common Sub. But it's impossible to say w/o knowing what each one does. Hth, Merjet |
All times are GMT +1. The time now is 04:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com