N
nicole62282
Allen,
I read a post of yours back in 2006 about incremental numbers and modified
the code that you posted to fit my needs. My incremental number starts over
each September and your code worked beautifully (you are a genius). The
following is the modified code that I used:
Private Sub payroll_dt_AfterUpdate()
Dim varMax As Variant
payroll_no = Right(Year(DateAdd("m", 4, [payroll_dt])), 2) & "-"
varMax = DMax("payroll_no", "tbl_payroll_no", "payroll_no Like """ &
payroll_no & "*""")
varMax = Val(Nz(Mid(varMax, 5), 0)) + 1
payroll_no = payroll_no & Format(varMax, "000")
End Sub
Let's say I used todays date and my last number used was 65...then the next
number looks like this...09-66. ("09" is the last 2 digits of the Current
Fiscal Year)
As I am still a novice to Access, I tested the code out and when it hits
09-100 it stops and goes back to 09-01.
Our numbers generally only go up to about 300 or so. Is there a different
piece of code I need to add or change to the above to let the number go past
100?
Thanks in advance.
I read a post of yours back in 2006 about incremental numbers and modified
the code that you posted to fit my needs. My incremental number starts over
each September and your code worked beautifully (you are a genius). The
following is the modified code that I used:
Private Sub payroll_dt_AfterUpdate()
Dim varMax As Variant
payroll_no = Right(Year(DateAdd("m", 4, [payroll_dt])), 2) & "-"
varMax = DMax("payroll_no", "tbl_payroll_no", "payroll_no Like """ &
payroll_no & "*""")
varMax = Val(Nz(Mid(varMax, 5), 0)) + 1
payroll_no = payroll_no & Format(varMax, "000")
End Sub
Let's say I used todays date and my last number used was 65...then the next
number looks like this...09-66. ("09" is the last 2 digits of the Current
Fiscal Year)
As I am still a novice to Access, I tested the code out and when it hits
09-100 it stops and goes back to 09-01.
Our numbers generally only go up to about 300 or so. Is there a different
piece of code I need to add or change to the above to let the number go past
100?
Thanks in advance.