Results 1 to 8 of 8
  1. #1
    Join Date
    May 2025
    Posts
    5

    Type error in some calculations

    Been using this DB for 15 years (that someone else created). Now this year it decides to give me errors. Every year I add a new table called Registrations, and change the name of the old Registrations by adding the year. Every year, I use the same report also called Registrations.

    This year, when it generates the report, it gives me a Type error, one SOME of the calculations in the Report Footer. An example of a calculation is, ="Campers: " & [CamperCount]. I finally discovered what CamperCount is. It is a formula, in the Detail section of the report =If([ClubName.District]="51",1,0). There is a table called ClubName and there is a field called District.
    Last edited by The1MegaByte; 05-22-2025 at 10:30 AM. Reason: add more info

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,551
    Check your data.
    ClubName.District is likely Null in at least one record.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Join Date
    May 2025
    Posts
    5

    Yes, but same errors

    Quote Originally Posted by Welshgasman View Post
    Check your data.
    ClubName.District is likely Null in at least one record.
    Thank you for your help.

    Yes, ClubName.District was blank in one record.
    However, I am still being asked to enter a value for ClubName.District.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Shouldn't even be creating a new table each year. Should be one table with a field that allows filtering records by year.

    Shouldn't really need table name in that expression unless same field name is used in various tables and those tables are in recordsource. Expression should also work if field is Null and return 0.

    Is District field a number or text type? If number, don't use quote marks around 51.
    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.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,551
    Upload the db with enough to see the issue AND instructions on how to recreate.
    If you need to obscure the data, use this on a copy
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    Join Date
    May 2025
    Posts
    5
    Quote Originally Posted by June7 View Post
    Shouldn't even be creating a new table each year. Should be one table with a field that allows filtering records by year.
    Well that's a good idea

    Quote Originally Posted by June7 View Post
    Shouldn't really need table name in that expression unless same field name is used in various tables and those tables are in recordsource. Expression should also work if field is Null and return 0.

    Is District field a number or text type? If number, don't use quote marks around 51.
    District is ShortText

  7. #7
    Join Date
    May 2025
    Posts
    5
    Quote Originally Posted by Welshgasman View Post
    Upload the db with enough to see the issue AND instructions on how to recreate.
    If you need to obscure the data, use this on a copy
    I imported the forum into a copy of the DB. But it shows the someone else's Tables and Fields, (seems to be about court).

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,551
    You run that code against your dB. Follow the instructions.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 2
    Last Post: 01-15-2020, 05:51 PM
  2. Replies: 2
    Last Post: 01-24-2019, 10:49 PM
  3. Replies: 30
    Last Post: 09-30-2015, 10:58 AM
  4. help in some calculations and searching
    By Nokia N93 in forum Access
    Replies: 7
    Last Post: 04-28-2013, 01:13 PM
  5. Replies: 2
    Last Post: 01-13-2012, 02:33 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