Hello,
I have a system in which makes project number by running a vb function.
Here is the function below:
frm.txtUniProjNum = Format(Nz(DMax("[tbl_MasterProj].UniProjNum", "tbl_MasterProj"), 0) + 1, "0000")
UniProjNum is a text field in tbl_MasterProj. The numbering has worked great for awhile. As you can see the numbering convention is "0000" so the numbers will have leading zeros. Recently the numbering convention must have 5 numbers instead of 4. I thought, I could simply update this line of code to "00000" for it to add another leading zero. It worked one time correctly, add the next incremental number. After the first time, every time I ran the code to generate a new number, it would continue to give me the same number over & over. Is there a reason why it would only do it once & then it would continue to use the same number over & over again?
For example, last number using the 4 digit convention is "1387", now after 5 digit convention the next number generated is "01388" <Perfect so far>, next number it generates after that is "01388"...So on & so forth.
Any thoughts?
Thanks,
~roystreet
I have a system in which makes project number by running a vb function.
Here is the function below:
frm.txtUniProjNum = Format(Nz(DMax("[tbl_MasterProj].UniProjNum", "tbl_MasterProj"), 0) + 1, "0000")
UniProjNum is a text field in tbl_MasterProj. The numbering has worked great for awhile. As you can see the numbering convention is "0000" so the numbers will have leading zeros. Recently the numbering convention must have 5 numbers instead of 4. I thought, I could simply update this line of code to "00000" for it to add another leading zero. It worked one time correctly, add the next incremental number. After the first time, every time I ran the code to generate a new number, it would continue to give me the same number over & over. Is there a reason why it would only do it once & then it would continue to use the same number over & over again?
For example, last number using the 4 digit convention is "1387", now after 5 digit convention the next number generated is "01388" <Perfect so far>, next number it generates after that is "01388"...So on & so forth.
Any thoughts?
Thanks,
~roystreet