Results 1 to 12 of 12
  1. #1
    gunterh is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2022
    Posts
    7

    Problem grouping

    Hello, I made a query based on a table.


    Now I want to use this query on a report, with grouping.
    When I want to group on CODE ( based on the result of a formula, I get an error : "invalid call procedure" )

    I don't find the problem.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you dont use semi's in INSTR,
    INSTR([prodID],"-")

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725

  4. #4
    gunterh is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2022
    Posts
    7
    Yes, I know, the query gives me the right result as i want, but when i use this query in a report, and I start grouping through the report it gives me an error on the code

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    You have to say what the error is and where it happens?
    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
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Perhaps you could post a copy of your database with only enough records to highlight the issue. I'm sure some on the forum could help resolve the issue if they had access to the code and logic involved.

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    You have to say what the error is and where it happens?
    like in post one (& maybe 4)?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    Is there a value for every code?
    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

  9. #9
    gunterh is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2022
    Posts
    7

    value

    Quote Originally Posted by Welshgasman View Post
    Is there a value for every code?
    yes for every code I have a value.

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    Probably now is the time to compact the DB and upload it with non sensitive data?
    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

  11. #11
    gunterh is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2022
    Posts
    7

    Problem solved

    Quote Originally Posted by Welshgasman View Post
    Probably now is the time to compact the DB and upload it with non sensitive data?
    Found the problem there was one record with a / sign instead of a - , in the numbering of my code. Normally it is 00-000 but in one record it was 00/000 and that was the error.
    SO problem solved.
    Tnx for all the answers

  12. #12
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    So how did the query work?
    My thinking was that it did not find the -, so the value for the Left would be zero?, but that would still error in the query surely?

    Edit:
    Hmm, seems Left() accepts a zero and returns nothing, whilst Mid() chokes and gives that error?
    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: 1
    Last Post: 09-23-2018, 07:10 AM
  2. Replies: 6
    Last Post: 07-06-2015, 11:57 AM
  3. Report Grouping Problem
    By bradycat in forum Access
    Replies: 7
    Last Post: 05-12-2015, 05:02 PM
  4. IIF Grouping Query Problem
    By cbh35711 in forum Access
    Replies: 1
    Last Post: 03-16-2012, 07:10 AM
  5. Grouping, Summing, and Ranking Problem
    By cadsvc in forum Reports
    Replies: 3
    Last Post: 04-16-2011, 11:34 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