Results 1 to 13 of 13
  1. #1
    pintojm is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2013
    Posts
    7

    Having trouble using check boxes

    Hey guys,
    I've hit a brick wall with a form I'm designing but I'm pretty new to access so I'm hopeful for a quick fix. I've designed a form that populates a table with several fields. 5 of the 7 work perfectly; however, the two with check boxes are giving me fits. One is supposed to be a "check only one" while the other's a "check all that apply". Neither populate the desired fields in the table. Do I need to change the data type in the table before they'll auto fill? Or is there something special to do in form design view? I built the form from scratch so I may have neglected to do something.
    Thanks,
    Pinto

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    A checkbox is designed to save a 0 or -1 value into a Yes/No type field if it is bound to that field. The 'check all that apply' doesn't fit that conventional structure. Closest thing to that would be a multi-value field with a multi-select combo or list box bound to a text field. I NEVER use multi-value fields.
    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.

  3. #3
    mrojas is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Location
    Concord California
    Posts
    72
    Can you post a copy of the form? I picture is worth...

  4. #4
    pintojm is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2013
    Posts
    7

    Screenshot

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	18 
Size:	117.7 KB 
ID:	13787

    Hopefully this helps.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    That will require code (I use only VBA).

    So in the checkbox Change event procedure:

    If Me.checkboxName = True Then
    Me!fieldname = "DNA"
    Else
    Me!fieldname = Null
    End If

    However, this is not a normalized data structure and I think will cause you issues in future.
    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.

  6. #6
    pintojm is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2013
    Posts
    7
    Ok thanks. So do you think I would be better off in the long run by simply using a drop list or combo box or something?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Oh wait, I thought you meant each checkbox had an associated field. But if there really are only two fields (not 38) then 2 comboboxes would be simpler. Otherwise, need code to save appropriate value.
    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.

  8. #8
    pintojm is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2013
    Posts
    7
    Ok so I have the combo boxes in my form now, but in my test runs they still aren't populating the appropriate fields in the table. The table fields are both currently formatted as "text". Do I need to change this? I want it to work out so that if I select "Option A" in the Branch combo box, Option A shows up in the Branch field on my table.
    Last edited by pintojm; 09-18-2013 at 01:23 PM. Reason: clarification

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is the form bound to the table? Did you set the Control Source property of each combobox?
    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.

  10. #10
    pintojm is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2013
    Posts
    7
    I have the correct columns in the respective bound column boxes on the property tab but idk what to put for control source. The drop arrow provides every field but the two I need as options.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Then those fields are not included in the form RecordSource. Is the RecordSource a reference to table or query or an SQL statement?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  12. #12
    pintojm is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2013
    Posts
    7
    Report - Copy.accdb

    Thanks again for all your help.

  13. #13
    pintojm is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2013
    Posts
    7
    Annnd I think I just got it. Formatted the box as a Value List and then just typed in what I want and it populated the table.

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

Similar Threads

  1. Trouble programming combo boxes
    By trolleri in forum Forms
    Replies: 6
    Last Post: 04-10-2013, 02:00 PM
  2. Trouble with Disappearing Boxes
    By ineedaccesshelp in forum Forms
    Replies: 10
    Last Post: 11-28-2012, 11:54 AM
  3. Cascading Combo Boxes trouble
    By Monterey_Manzer in forum Access
    Replies: 4
    Last Post: 09-13-2012, 11:06 AM
  4. Trouble with check if Exists before Edit or Add Record
    By mrfixit1170 in forum Programming
    Replies: 4
    Last Post: 02-10-2012, 10:38 AM
  5. 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

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