XL2002 - Resetting Checkbox values on Multipage Form

  • Thread starter Trevor Williams
  • Start date
T

Trevor Williams

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
 
M

merjet

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
 
T

Trevor Williams

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top