Results 1 to 3 of 3

Thread: [Resolved]Little Question about Checkbox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    301

    Resolved [Resolved]Little Question about Checkbox

    I have a very little question about a Checkbox.
    How to make that it does something when checked or not.
    So I have a
    CMD Button
    Check1.

    With cmdbutton must it be somethng like: if Check1 = Checked then Msgbox "owyeah" else "Check it"

    LoLzz

    Thnx
    Last edited by Account; Sep 2nd, 2006 at 01:30 PM.

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Little Question about Checkbox

    VB Code:
    1. Private Sub Check1_Click()
    2.     If Check1.Value = vbChecked Then
    3.         'do something
    4.     Else
    5.         'do something
    6.     End If
    7. End Sub
    8.  
    9. Private Sub Form_Load()
    10.     'for example
    11.     Call Check1_Click
    12. End Sub

    With a CMD:

    VB Code:
    1. Private Sub Command1_Click()
    2.     If Check1.Value = vbChecked Then
    3.         MsgBox "It's checked!"
    4.     Else
    5.         MsgBox "It's not checked!"
    6.     End If
    7. End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    301

    Re: Little Question about Checkbox

    and it works, thank you :]
    I want to add some reputation to you but I have to spread some ;[

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width