Hi and thank for all the Help/suggestions:
I have a table records with a "data creation" field and a "sequential number" field.
On the same table, I need to generate a "sequential number" and a "code number" like: YYYY+"0"+(sequential number starting from "1", EVERY YEAR).
For example:
RECORD 1 - 2015/07/02 - Seq.number 1 - Code: 201501
RECORD 2 - 2015/07/02 - Seq.number 2 - Code: 201502
RECORD 3 - 2015/07/02 - Seq.number 3 - Code: 201503
RECORD 4 - 2016/07/02 - Seq.number 1 - Code: 201601
RECORD 5 - 2016/07/02 - Seq.number 2 - Code: 201602
I need to generate the code, when filling the Data Entry form.
I fill the Data field, and then i need the code (if is possible visualize it on the Form).
This is what i think:
Insert the data field.
On updating the data field, start a vba code that take from the data field only the year.
Inser the year in a field.
Start a query that take the year from the field, and search all the records that match the year.
From that, searche the "last seq_code".
Take that last code, add 1, and put in the seq_code of the record.
Generate and concatenate the code with: year+0+seq_code.
I hope you understand.
Thank again.
Francesco F
I have a table records with a "data creation" field and a "sequential number" field.
On the same table, I need to generate a "sequential number" and a "code number" like: YYYY+"0"+(sequential number starting from "1", EVERY YEAR).
For example:
RECORD 1 - 2015/07/02 - Seq.number 1 - Code: 201501
RECORD 2 - 2015/07/02 - Seq.number 2 - Code: 201502
RECORD 3 - 2015/07/02 - Seq.number 3 - Code: 201503
RECORD 4 - 2016/07/02 - Seq.number 1 - Code: 201601
RECORD 5 - 2016/07/02 - Seq.number 2 - Code: 201602
I need to generate the code, when filling the Data Entry form.
I fill the Data field, and then i need the code (if is possible visualize it on the Form).
This is what i think:
Insert the data field.
On updating the data field, start a vba code that take from the data field only the year.
Inser the year in a field.
Start a query that take the year from the field, and search all the records that match the year.
From that, searche the "last seq_code".
Take that last code, add 1, and put in the seq_code of the record.
Generate and concatenate the code with: year+0+seq_code.
I hope you understand.
Thank again.
Francesco F