Results 1 to 6 of 6
  1. #1
    ultra5219 is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Feb 2013
    Posts
    45

    Talking How to Set Validation For Check BOX if Box is Null (not selected either BoxA or BoxB)

    Hi guys
    can anyone can teach me short tutorial how to set validation in Access 2007 for check box?
    im planning to create small database for check box. lets say IF i didnt Select Any Check BOX, IT pop up on screen says, "Please Select Either BoxA or Box B" which i press ADD button. well i did try from this site: http://stackoverflow.com/questions/1...-of-checkboxes



    That tutorial shows required select Only Either BoxA or BoxB. How to set Validation IF i didnt select any of Box?

    Sorry Bad English
    PS: i attach my sample database file
    Thanks
    Attached Thumbnails Attached Thumbnails warning.jpg  
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I would use the form's before update event:

    http://www.baldyweb.com/BeforeUpdate.htm

    in your case testing the two check boxes.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ultra5219 is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Feb 2013
    Posts
    45
    Quote Originally Posted by pbaldy View Post
    I would use the form's before update event:

    http://www.baldyweb.com/BeforeUpdate.htm

    in your case testing the two check boxes.
    I see.. So how to do that?
    im very weak in programming actually. Can you try edit my database file which i attach above so that i can check back how u do that

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Are these checkboxes bound to Yes/No fields?

    If user should select only one (A or B) then this should be a single field, not two. If you want two controls and need to limit entry to one, use an OptionGroup control with 2 radio buttons. The OptionGroup control would be bound to the field and save the value (0 or -1) of the selected radio button.

    Alternative is a combobox with two options - A or B which would be aliases for the 0/-1 values.

    Make the field a required field and user cannot leave record without entering value. Access will nag user to enter data.

    No code needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ultra5219 is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Feb 2013
    Posts
    45

    Unhappy

    Quote Originally Posted by June7 View Post
    Are these checkboxes bound to Yes/No fields?

    If user should select only one (A or B) then this should be a single field, not two. If you want two controls and need to limit entry to one, use an OptionGroup control with 2 radio buttons. The OptionGroup control would be bound to the field and save the value (0 or -1) of the selected radio button.

    Alternative is a combobox with two options - A or B which would be aliases for the 0/-1 values.

    Make the field a required field and user cannot leave record without entering value. Access will nag user to enter data.

    No code needed.
    Yup.. the checkboxes are bound to YES/No Fields.
    actually my database which i want to create is about collecting student card.
    Assuming that BOXA is Collected Card and BoxB is Defective Card (which damaged when printing the new student pass)

    thats why when im key in all information, the checkbox must be selected either one. it cannot be empty or null.
    if checkbox is not selected, it pop up on screen says "please select the checkbox". then i can add record on database.
    how to do that? can u help me to edit my database?
    i attach my latest database here.
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    What did you not understand about the info I already provided?

    My suggestion that there should be only 1 field instead of 2?

    Or the use of OptionGroup?

    Or the use of combobox?

    Or how to make the field required data entry?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Data Validation: check for special characters
    By mabrande in forum Access
    Replies: 11
    Last Post: 08-22-2013, 02:18 AM
  2. Check if record exists, Check Number
    By burrina in forum Forms
    Replies: 9
    Last Post: 01-06-2013, 03:49 PM
  3. Debug on validation check
    By GraemeG in forum Programming
    Replies: 1
    Last Post: 02-23-2011, 01:19 PM
  4. To check or Un-Check all Boxes in a form
    By devcon in forum Forms
    Replies: 7
    Last Post: 05-01-2010, 12:03 AM
  5. Replies: 2
    Last Post: 03-13-2009, 08:35 AM

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