Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access 2003: Check boxes and tally

    Wow! It's been years since I have been on this site. I am happy to report I am building Access Databases again....

    This is more of a design quuestion...

    Access 2003 (the client still has not upgraded)

    I want to build a FORM where there will be 10 checkboxes. These checkboxes are actually numerical values. 14-10-4-4-8-2 etc

    One or ALL can be checked.

    At the bottom of the form, I want to tally based on the Checkbox value...

    Whats the best way to go about it.

    I think I want to place a checkbox and then a FieldBox next to it so that the user can see what points were assigned (for instant gratification). And then have that total at the bottom.

    I would need those values to be saved somewhere so I can use it for reports.

    Thanks and keep up the good work.....

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    C1fer,

    Attached is an example form which will do what you want. Of course I'm sure it isn't the most efficient code as I was aiming at functionality vs efficiency. You'll also want to tie some of the fields to your database but this does give you the conceptual framework to get it going. Hit Alt+F11 to check out the code.
    Attached Files Attached Files
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That was awesome. Thanks for the reply. While waiting, I actually searched for older POSTS that I have done and found the answer. Seems I asked a similar question before.

    In any case I ended up using the same codes as you, but I did pick up the new SubTotal code you submitted so THANK YOU

  4. #4
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is another quick one:
    I want to award 10 points for every $100 sold

    BOX1: enter amount (over 100)
    Box2: Box1/100 * 10

    ie: $4,689 = 46 * 10 = 460 Points

  5. #5
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update

    I quick thought:

    I wanted to write code to say:

    If Box2 = <=999 then left Box1(1) * 10 (ie... 984 = 90 Points)
    If Box2 = 1000-9999 then Box1(left (2) * 100 (ie... 5984 = 590 Points)
    If Box2 = >=10000 then Box1(left (3) * 100 (ie... 15984 = 1590 Points)

    I have already created 3 Update queries that I can run and give me the numbers, but its clunky....

    Thanks

  6. #6
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    C1fer,

    Why not just Int(clng(Box1)*.1) ?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  7. #7
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks RG:

    That works but I need to round it off.

    I need to award 10 points for every 100.

    756 gives me 7 x 10 = 70 points

    but 8,967 is giving me 896 instead of 890 points

  8. #8
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    In that case: FLOOR(clng(Box1)*.1,10) or Int(clng(Box1)*.01)*10
    Attached Images Attached Images
    Last edited by RetiredGeek; 2011-03-04 at 16:16. Reason: Add more info & graphic
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •