Results 1 to 5 of 5
  1. #1
    Xterra14s is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2016
    Posts
    32

    Query form getting 1 of 0 records...

    So a form that I have is pulling 1 of 0 Records when using this code: ="Record " & [CurrentRecord] & " " & "of " & Count(*)


    It's counting a blank record as 1 when there are no records. Any idea how I can get it to say 0 of 0?

    Thank you!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    iCnt = Dcount("*","table/query")

  3. #3
    Xterra14s is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2016
    Posts
    32
    Quote Originally Posted by ranman256 View Post
    iCnt = Dcount("*","table/query")
    That gave me an error

  4. #4
    Xterra14s is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2016
    Posts
    32
    The code I have does work except for when the table is blank. If I search a number and it shows 2 or 3 for example its working fine and same with 1 of 3. The only time it doesn't work is when there is no records to show. It states 1 of 0 because it's counting the blank form as 1 record.

  5. #5
    Xterra14s is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2016
    Posts
    32
    Hows this look?

    =IIf([CurrentRecord]>Count(*), "0" "of " & Count(*) ,(="Record " & [CurrentRecord] & " " & "of " & Count(*)))

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

Similar Threads

  1. form based on query - cant edit records
    By tweety in forum Forms
    Replies: 7
    Last Post: 04-10-2013, 03:42 PM
  2. Replies: 1
    Last Post: 07-26-2012, 10:51 AM
  3. Query by form does not show all records
    By 011billyw in forum Forms
    Replies: 20
    Last Post: 03-20-2012, 05:10 PM
  4. Replies: 10
    Last Post: 12-21-2011, 01:24 PM
  5. open form if no records in query
    By MiaAccess in forum Forms
    Replies: 1
    Last Post: 03-05-2011, 12:11 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