Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Quanada is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Rahway, NJ
    Posts
    8

    Function called from form returning #Error - Please help!


    Not sure why this isn't working - I haven't programmed in years! Please ignore the double equal signs, I did that just to make it fit on the screen for this image; it was NOT originally like that... I forgot to change it to a plus in the rush to get the question out; please forgive me.
    Attached Thumbnails Attached Thumbnails error.jpg  

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    You have a line with two = signs in


    Sent from my iPhone using Tapatalk

  3. #3
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    And should you design the function in case all values are zero? The avg part then won't work.


    Sent from my iPhone using Tapatalk

  4. #4
    Quanada is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Rahway, NJ
    Posts
    8
    Yes sorry I just put that there to make it fit on the screen, it wasn't like that when the error originally and continues to occur... as to the all zeroes, i will of course add that in, i would just like it to work first

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Have you debugged the two key values before the avg part


    Sent from my iPhone using Tapatalk

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,740
    Perhaps you should define the arguments in the function as Long or Decimal.

  7. #7
    Quanada is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Rahway, NJ
    Posts
    8
    I will try decimal... Andy, I suspect that it is never getting into the Function as I have breakpoints established and they are never getting hit... In green, I have commented the call in the unbound text box used to call this function...

  8. #8
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Isn't there an upper limit on integers? Long may be better as dave said. Just spotted it.


    Sent from my iPhone using Tapatalk

  9. #9
    Quanada is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Rahway, NJ
    Posts
    8
    Still the same it's not even hitting the breakpoint... I haven't done this in years...lol
    Click image for larger version. 

Name:	error.jpg 
Views:	8 
Size:	278.2 KB 
ID:	28187

  10. #10
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Sumtotalavm as long.


    Sent from my iPhone using Tapatalk

  11. #11
    Quanada is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Rahway, NJ
    Posts
    8
    no, that doesn't change anything... i'm pretty sure it's never getting to this code... ah well, thanks for the assistance...

  12. #12
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Where are you calling the function?


    Sent from my iPhone using Tapatalk

  13. #13
    Quanada is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Rahway, NJ
    Posts
    8
    in an unbound text box, the commented section of the code is the call used

  14. #14
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    I'm assuming those fieldnames are part of the data source of the form?[emoji19]


    Sent from my iPhone using Tapatalk

  15. #15
    Quanada is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Rahway, NJ
    Posts
    8
    Yes they are the exact names used in the table

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

Similar Threads

  1. Replies: 7
    Last Post: 01-04-2016, 01:10 PM
  2. Replies: 5
    Last Post: 01-24-2014, 09:05 AM
  3. Replies: 10
    Last Post: 12-27-2013, 02:54 PM
  4. Replies: 3
    Last Post: 01-08-2013, 11:51 AM
  5. Function returning Error 91 (can't Figure out)
    By FrustratedAlso in forum Access
    Replies: 2
    Last Post: 04-17-2012, 02:55 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