Results 1 to 2 of 2

Thread: Checking a Checkbox??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184

    Post

    How do you ( in the Formload ) Tell a checkbox to be checked?? And how do you ask if it is checked or not??

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    In Form's Load Event write this code:
    Code:
    Private Sub Form_Load()
        Check1.Value = Checked
    End Sub
    I'm not sure what you are asking about in second part. Do you mean how to check if Checkbox is checked? If that's the case then use this:
    Code:
        If Check1.Value = Checked Then
            'do something
        ElseIf Check1.Value = Unchecked Then
            'do something else
        End If
    Or do you want to ask user if the check box has to be checked or not. In this case use this:
    Code:
        If MsgBox("Check Checkbox?", vbYesNo, "Checkbox") = vbYes Then
            Check1.Value = Checked
        Else
            Check1.Value = Unchecked
        End If
    HTH

    Edited by QWERTY on 02-28-2000 at 06:40 PM

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