Results 1 to 4 of 4
  1. #1
    shydoc is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    2

    Populating textbox with num of total record with result from a select count query

    How to populate a textbox in a form the number of total record in a particular table.



    In the forms textbox, this is what I did but its not working.

    control Source: =[select Count(*) from tblname]

    but getting #NAME?

    How can I solve this problem. Thank you.

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    try =Dcount("*","tblName")
    You can add criteria too like =Dcount("*","tblName","[tblField]>10")

  3. #3
    chuki2 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Location
    Selangor,Malaysia
    Posts
    26
    Yes, use Dcount to count...

    Let say :

    Code:
    me.countTextBox=Dcount("idUser","tblUser")
    Hope can help you

  4. #4
    shydoc is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    2
    Quote Originally Posted by amrut View Post
    try =Dcount("*","tblName")
    You can add criteria too like =Dcount("*","tblName","[tblField]>10")

    =Dcount("*","tblName") is what I needed, Thank you very much amrut and chuki2

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

Similar Threads

  1. Replies: 7
    Last Post: 05-02-2012, 08:04 AM
  2. Getting the Total after a result
    By rjbautista20 in forum Queries
    Replies: 4
    Last Post: 01-22-2012, 01:43 AM
  3. Replies: 17
    Last Post: 08-19-2011, 01:19 PM
  4. Replies: 1
    Last Post: 02-04-2010, 01:15 PM
  5. Result of Count Query not known elsewhere
    By Carole in forum Access
    Replies: 1
    Last Post: 09-07-2008, 09:39 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