Results 1 to 4 of 4
  1. #1
    Amen is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Sep 2013
    Posts
    19

    Checkbox problem if Yes or No

    I'm new to access database. I have a check box "Yes" or "No" to choose...all i want, if i check "YES" it continues to the next step..If "No" skip the next 3 or 4 steps and move to the other steps...I'm not sure how can i do this


    can someone share some lights here..

    thanks in advance

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    You can try the IF THEN ELSE statement. You can skip lines by using GoTo or enclose the code you want to execute after THEN and before END IF.

    If Me.chkBox = -1 Then 'User ticked yes
    MsgBox "User ticked Yes"
    ElseIf Me.chkBox = 0 Then
    msgBox "User ticked No"
    Else
    msgBox "This Yes No field has gone unchanged and is a Null value"
    End if

    Goto My_New_Line_Of_Code

    MsgBox "I got skipped Over!"

    My_New_Line_Of_Code:

    MsgBox "THis is a good place to start"

  3. #3
    Amen is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Sep 2013
    Posts
    19
    thanks for your reply

    Do i need to write this code on "on click" Under Events?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Build a new form. Name it something like Test or frmTest.

    Go into Edit view. Turn off your wizard or if it starts, click cancel. You are going to add a couple controls.

    Create a Checkbox and give it a name. Using the "Other" on the check box's properties name it chkBox

    Create a Control Button and name it cmdTest

    Create a sub routine for your Button named cmdTest. The sub routine will be a click event.

    paste all of the code into the click event you just created.

    Open your form and click the button you created. Then, change the value of your Check Box and click the button.


    Not sure what your end goal is but the code I provided you is fairly intuitive. A light bulb might go off and your next question may be for a different subject. Update this thread regardless of the outcome.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-05-2013, 09:48 AM
  2. Problem with my checkbox vba code
    By wrkadri in forum Programming
    Replies: 2
    Last Post: 12-13-2012, 02:12 AM
  3. Checkbox
    By huongdl1987 in forum Forms
    Replies: 1
    Last Post: 06-23-2011, 05:29 PM
  4. Using a checkbox help
    By gbjc105 in forum Forms
    Replies: 1
    Last Post: 01-28-2010, 08:27 PM
  5. Checkbox
    By Rbtsmith in forum Access
    Replies: 2
    Last Post: 02-17-2009, 04:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums