Page 3 of 3 FirstFirst 123
Results 31 to 43 of 43
  1. #31
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    The sample did not have the calcs for Null and did not allow shrink.

    I always explicitely specify the alternate value for Nz() function, otherwise I believe the value will be empty string and that is not desired for math operation.

    Nz(PaymentReceived1st,0)

    Are the report records properly filtering?

    The issue is still just the sum?
    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.

  2. #32
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    The sample did not have the calcs for Null and did not allow shrink.
    yes I was wondering if that was an issue
    Quote Originally Posted by June7 View Post
    I always explicitely specify the alternate value for Nz() function, otherwise I believe the value will be empty string and that is not desired for math operation.

    Nz(PaymentReceived1st,0)
    note: when I did this (added the ,0 to the nz()) I get a cannot function error but it still works and lets me save it that way. (I was adding that to the isnull() edit that comment out of history)
    Quote Originally Posted by June7 View Post
    Are the report records properly filtering?

    The issue is still just the sum?
    yes - and they collapse correctly and hide correctly

    I made a copy of the company front end and removed the formulas on the text boxes in the detail section so that the only formula would be sum - I still get an error so it is something I must have wrong in the sum regardless of any of the fields.

    Also

    with

    =Sum(IIf([PaymentDepositDateBanked]<>[Forms].[frmCompanyTaxInvoices].[txtDate],0,Nz([PaymentDepositReceived],0))+IIf([PaymentDateBanked1st]<>[Forms].[frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentReceived1st],0))+IIf([PaymentDateBanked2nd]<>[Forms].[frmCom

    does it matter when you use . vs ! when typing forms!frmcompanytaxinvoices!txtdate

    ?

    I noticed sometimes you use . .ie forms.frmcompanytaxinvoices!txtdate

  3. #33
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Sorry, the sample works and should be translatable to other db.

    I did not have to use Format on the dates. Maybe that's an issue. Format results in a string value, not a date, although Access and VBA should be able to automatically recognize the string as date if properly formatted and reconcile.

    Are you not in U.S.? International date can be problemmatic. Have you seen http://allenbrowne.com/ser-36.html
    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.

  4. #34
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    Sorry, the sample works and should be translatable to other db.

    I did not have to use Format on the dates. Maybe that's an issue. Format results in a string value, not a date, although Access and VBA should be able to automatically recognize the string as date if properly formatted and reconcile.

    Are you not in U.S.? International date can be problemmatic. Have you seen http://allenbrowne.com/ser-36.html
    I'm looking for any possibilty - making sure dates work. It filters fine, shrinks fine. It's just the sum

    I am only summing the fields and making sure each text box is labelled "txtFieldName" and not their source name just to clear any mismatch confusion but I still get the error.

    I have the sample working perfectly the way I want it to as you can see here

    https://www.dropbox.com/s/5vbw8mzqiq...atabase3.6.zip

    How could I know if it is a date string error?

    update: I am reading through Allen's page - (I should fly to Perth and just ask him )

    A picture of the table fields - everything seems to be in order.
    Click image for larger version. 

Name:	Capture.JPG 
Views:	8 
Size:	40.4 KB 
ID:	14543

  5. #35
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    If I use

    =Sum(IIf([PaymentDateBanked1st]<>[Forms]![frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentReceived1st],0))+IIf([PaymentDateBanked1st]<>[Forms]![frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentReceived2nd],0))+IIf([PaymentDepositDateBanked]<>[Forms]![frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentDepositReceived],0)))

    I get # error

    If I remove one and go with

    =Sum(IIf([PaymentDateBanked1st]<>[Forms]![frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentReceived1st],0))+IIf([PaymentDateBanked1st]<>[Forms]![frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentReceived2nd],0)))

    it works

    so there is something wrong with deposit

    update:

    ok - if I sum any two it works, 3 it doesn't. WHY??

  6. #36
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    You have PaymentDateBanked1st in the expression twice, should one be PaymentDateBanked2nd?

    However, doubt that will resolve issue of 3rd term.

    The expression with 3 terms is longer than 255 characters but I didn't think that was the limit on expressions.

    The . provokes intellisense popup tips in VBA.

    Forms!frmCompanyTaxInvoices. will not trigger intellisense but Form_frmCompanyTaxInvoices. does.

    The first is used by Access in objects, the second is VBA exclusive. Look at the objects listed in VBA editor and note the prefix - Form_, Report_.
    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.

  7. #37
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    You have PaymentDateBanked1st in the expression twice, should one be PaymentDateBanked2nd?

    However, doubt that will resolve issue of 3rd term.

    The expression with 3 terms is longer than 255 characters but I didn't think that was the limit on expressions.

    The . provokes intellisense popup tips in VBA.

    Forms!frmCompanyTaxInvoices. will not trigger intellisense but Form_frmCompanyTaxInvoices. does.

    The first is used by Access in objects, the second is VBA exclusive. Look at the objects listed in VBA editor and note the prefix - Form_, Report_.
    so renaming the fields to say p1, p2, p3 d1, d2, d3 could help solve the 255 character limitation? (I could make some fields in the record source of the report) i.e. p1: PaymentReceived1st

    I will now be using form_ in vba from here on

  8. #38
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    It was character limitation!

    I made each in the record source to a duplicate shorter version

    Payment1st
    tblTeacher


    became
    p1: Payment1st
    tblTeacher

    This solved the problem and I get no more #error!


  9. #39
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Out of Curiosity - if you made it a memo field or longer character on the textbox would that also solve the problem?

  10. #40
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Length of expression in ControlSource property has nothing to do with field content.
    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.

  11. #41
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    Length of expression in ControlSource property has nothing to do with field content.
    is there an option to increase it anywhere?

  12. #42
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    There is not.
    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.

  13. #43
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    There is not.
    Thank you very kindly for the help June7 - huge learning curve for me but you make it easier.

    Cheers!

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 09-21-2013, 04:53 AM
  2. Linked Tables Giving Error Message
    By 18ck in forum Access
    Replies: 2
    Last Post: 11-23-2012, 06:30 AM
  3. DCount on a Query giving #Name? error
    By Huddle in forum Access
    Replies: 9
    Last Post: 06-20-2012, 11:40 AM
  4. DLookUp function giving invalid use of null error
    By shubhamgandhi in forum Programming
    Replies: 4
    Last Post: 07-21-2011, 06:04 PM
  5. NoData() still giving me an error.
    By cowboy in forum Programming
    Replies: 3
    Last Post: 04-08-2010, 12:26 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