[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Check boxes in VB

In VB for check boxes:
1.Where do you write the code (under the chkbox or the cmdbutton?)
2.If you have a no. of boxes and each returns a value which are added for a total how do you structure the code?Examples please.Thanks.
1 Solution
1) You can write the code both under Check box and Command button. Both of them are having events.

2) I think you are going to have the value displayed in the caption. So whenever you click a check box if the ctatus is vbChecked add the value to a public variable and if vbUnChecked detuct the value.
1.If you want activate form like :
  If the user checks in the CheckBox  
  then in the same second somthing  
  append .then you sould write the code
  in the CheckBox .other you will write
  the code in the CommandButton .
2.you can use the CheckBoxes as Boolean
  sample :
  dim bCheck as boolean


 or you can ask about that in the IF sentance :

  if CheckBox1 then ...

                        Yuval Amir

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now