Results 1 to 5 of 5
  1. #1
    Colman is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    3

    Simple task but must be fast


    I have a main form which includes a subform displaying items from a query. The subform items have a checkbox which the user ticks to indicate that that item has been inspected.

    The simple task is to display a count of the number of items that have been ticked, on the main form. I did this by putting a set value and DCount statement in a macro on the checkbox after update property. This works but creates a delay for the user when ticking items. They need to be able to tick items rapidly at times.

    I have seen an SQL statement using SELECT COUNT etc which looks like what I need but have no idea where to put the statement.

    Can anyone help me out.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    D functions are not efficient

    If your inspection is in fact a yes/no field it's values are stored as -1 and 0 for yes and no respectively.

    you can sum the total inspect items by getting the absolute value of the sum of the yes no field. Let's say your field is actually called INSPECTED. Your formula would be

    Abs(Sum(Inspected))

  3. #3
    Colman is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    3
    Thanks for responding.

    Am I right to put this formula in a set value command in a macro on the checkbox 'after update' property, or is there a better way?

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Without knowing the setup of your form I couldn't say.

    If the checkboxes are on your main form you can just have an unbound text box with the formula I gave you in it (preceded by a = sign). If the checkboxes are in a subform it would be different, let's say your subform was called subForm1 you'd have something like

    =abs(sum(forms!mainform.subform!Inspected))

  5. #5
    Colman is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    3
    Thanks again. The checkboxes are in the subform.

    Getting 'Error' in the unbound text box when I put the formula in it.

    However, it works perfectly using a set value macro on an empty text box.

    This is a result. Many thanks.

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

Similar Threads

  1. Testing Task - Forms
    By collwill in forum Access
    Replies: 1
    Last Post: 03-09-2011, 10:25 PM
  2. Oncurrent event too fast?
    By Neutrino in forum Forms
    Replies: 24
    Last Post: 01-08-2011, 02:48 PM
  3. Replies: 2
    Last Post: 12-16-2010, 02:46 PM
  4. Very simple task - create many-to-one realtion
    By ganjan in forum Database Design
    Replies: 3
    Last Post: 06-03-2009, 01:57 PM
  5. Access Database size Grows too fast
    By no-e in forum Access
    Replies: 0
    Last Post: 12-16-2008, 02:29 PM

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