Results 1 to 5 of 5
  1. #1
    mrdave9 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    3

    Simple sql question

    I have table A with a number of check boxes.



    For a record in A I want to count how many check boxes are checked giving a number then update field in a corresponding record in table B with that number.

    Both tables have same record key field.

    I have coded the first part and have the count, but not sure how to code the UPDATE of Table B.

    I want to do this as a event of a button click on a form.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Your design May be wrong.
    Table A ,record 1, should have 1 check box.
    key, condition, chcheckbox,

    from here you can count the checkboxes, update, etc.

  3. #3
    knarfreppep is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Location
    Adelaide, Australia
    Posts
    106
    Try this -
    UPDATE tblB LEFT JOIN tblA ON tblB.lngID = tblA.lngID SET tblB.bytCount = IIf(tblA.ysnQ1,1,0)+IIf(tblA.ysnQ2,1,0)+...

  4. #4
    mrdave9 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    3
    Will give this a try

  5. #5
    mrdave9 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    3
    worked great tks

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

Similar Threads

  1. Simple question
    By blackstatic42 in forum Access
    Replies: 4
    Last Post: 07-22-2020, 08:50 AM
  2. If and Else - very simple question
    By tygereye in forum Access
    Replies: 38
    Last Post: 04-02-2014, 06:06 AM
  3. Simple question
    By M.West in forum Database Design
    Replies: 2
    Last Post: 08-16-2012, 12:41 AM
  4. Simple VBA Question
    By koper in forum Access
    Replies: 1
    Last Post: 01-20-2011, 12:07 PM
  5. Very simple question!
    By fiddley in forum Programming
    Replies: 2
    Last Post: 04-28-2009, 02:16 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