Results 1 to 3 of 3
  1. #1
    gmaster is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    May 2014
    Posts
    32

    Field counter


    Hi! I'm trying to write a vba code that cycles on selected fields of a table and counts how many records fill them (i.e. it has to skip and not count the empty cells)...is it possible?

    Edit: trying to be more specific, i have a table with a dozen column and i wanna perform the count on three of them, then sum the three values in order to obtain the total number of filled cells of those three columns

  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,646
    Why VBA? Try an aggregate query:

    SELECT Count(Field1) AS Count1, Count(Field2) AS Count2, Count(Field3) AS Count3 FROM tablename;
    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
    gmaster is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    May 2014
    Posts
    32
    Thanks, it works!

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

Similar Threads

  1. Replies: 1
    Last Post: 09-29-2014, 05:28 PM
  2. Counter
    By Skroof in forum Access
    Replies: 3
    Last Post: 05-14-2012, 08:25 AM
  3. Database Counter
    By Kapelluschsa in forum Access
    Replies: 5
    Last Post: 08-10-2011, 02:41 PM
  4. ID Counter Problem
    By slash23 in forum Access
    Replies: 2
    Last Post: 07-06-2011, 11:57 AM
  5. lap Counter
    By challenger in forum Access
    Replies: 4
    Last Post: 07-06-2010, 02:20 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