Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Quote Originally Posted by June7 View Post
    I am looking at frmCountOverdue. It has one textbox bound to CountOfRecordID.

    This expression in textbox should work: =Nz([CountOfrecordID],0)
    However, I get error "There is an error compiling this function. The Visual Basic module contains a syntax error. Check the code, and then recompile it."
    Your VBA has procedures with API calls that won't run on my 64-bit computer. I simply deleted the two procedures and then Access compiles properly and the expression is accepted.



    If there is a chance this db will run on 64-bit machines, need to research PtrSafe parameter in API declarations.
    I entered "=Nz([CountofRecordID],0)" (without quotes) into the text box. It still displays nothing when it should show zero.

  2. #17
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,973
    That's because there are no records that meet the WHERE and HAVING filter criteria. The query dataset is empty so there is no data to aggregate and no value for the textbox to evaluate in an expression.

    Personally, I wouldn't build a query and a form just to return a single value for display. I would use domain aggregate.

    =Nz(DCount("*", "tblDataPrime", "[toolNextCalDate]<Date() AND [toolActive]=True AND [toolLocat]<>'Scrap'"),0)
    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. #18
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Okay domain aggregate- never used this before.
    I'm inferring that I would input the expression into a text box directly on the desired form?

  4. #19
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Aggregate functions- I had never used now I love them. This will save a lot of time vs my previous methodology.

    Works great!

  5. #20
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,973
    Yes, they can be handy but also slow performers in queries and textboxes. Will be able to see the recalc take place.

    Sorry took me so long to grasp what you were doing and to finally present the alternative. Glad it works.
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Do not add leading zeros
    By phifer2088 in forum Access
    Replies: 5
    Last Post: 03-02-2015, 10:05 AM
  2. Leading Zeros
    By dirtbiker1824 in forum Access
    Replies: 1
    Last Post: 03-14-2011, 02:16 PM
  3. Hiding Zeros
    By Alex Motilal in forum Reports
    Replies: 2
    Last Post: 08-06-2010, 08:28 AM
  4. Getting rid of zeros
    By ceb39 in forum Reports
    Replies: 26
    Last Post: 05-31-2009, 12:49 PM
  5. leading 'Zeros' in data
    By wasim_sono in forum Forms
    Replies: 3
    Last Post: 04-06-2009, 11:57 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