Hi there
I'm attempting to make a fancy access program to replace our organisations current system of dozens excel spreadsheets and hundreds of word documents and even pen and paper.
Though I am supernew to all access (or coding in general) I am keen to give this whole database building thing a go!
Unfortunately I am stuck at the second requirement (of 20 or so) which is trying to create a process that assigns a reference automatically in a particular format. Specifically I need a reference made of a sequential or incremental number and then the year, e.g. or 6897/2020. Each year should reset to zero so if 6897/2020 was the last item of that year the next entry will be 1/2021.
Now I have used my best googling skills and understand that one should avoid this pathway unless necessary but sadly this reference gets used heavily in our organisation and it isn’t going to change. I also understand I should leave the autonumber ID in each table well alone. Finally I have seen hints that I could cheat and make this reference appear in forms but not in the tables, which I would be totally up for if its true [IMG]file:///C:/Users/Ben/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png[/IMG]
So far I am trying to proceed by doing the following.
1. Create column for Increments, one for year and separate column for reference which combines the two using the default value function.
2. Use 'before change' function (expression builder?) on Access 2019 to check that the current year(date()) is not same as the DMax (or is it just Max?), in the year column and if it does not match set increments to 1, else DMax Increments + 1.
So far I can't get anything to work, I tried using the following but I figured my lack of coding knowledge is part the issue
if DMax[TestYear]<>year(date()) then [Increments] = 1
Else DMax("Incremental") + 1
Any pointers on what I should actually be doing?