I have an app that creates an Incident Number for each form that is submitted. I have 5 choices of Incident Types that the user can choose from. I want the incremental number to be a different sequence for each Incident Type.
Here is my formula for creating the Incident Number:
TypeValue.Selected.Value & "-" & RptYearValue.Text & "-" & Last('[dbo].[wynne_incidents]').ID +1
How do I make different incremental number for each Type Value?
If by having a different "sequence" you mean you want a different 1,2,3, etc. for Type A as from Type B, C, D, or E, then you can't base it off of an ID field which (I assume) increments for ALL Types. Either you have to base it on a field in your table that increments only for each Type, or instead of using Last()+1 you have to use a CountIf()+1 and test for your Type matching. It isn't delegatable, but then, neither is Last().
Yes for example, right now I could have: ACC-2018-1, INC-2018-2, ACC-2018-3, etc.
but what I want is: ACC-2018-1, ACC-2018-2,.... and INC-2018-1, INC-2018-2, and so on with all of my Incident Types. The reason is because we like to be able to see a "quick look" of how many of a specific type we have in a year. Thanks!
I like the thinking there to get around the delegation issues, @Drrickryp, but how would you go about getting a Type-specific count? The formula you provided would get the next overall ID, but not an ID for the next Type A, for instance. Is there a way to do that while still avoiding delegation issues?
i have a really dirty solution that could help you,with no delegation problem ,create five column(text) for each type of number,every time you submit the form make the right type column true and the remain four false, then you can countrow filtered with the right column and set a variable +1 to the result of countrow.i hope it will help
Continue your learning in our online communities.
Next Wednesday, August 21st at 8am PDT
Let's thank our top community contributors
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Features releasing from April 2019 through September 2019!
August 20-23rd 2019