N
nicole62282
I have read posts over and over trying to figure this out, but can't seem to
piece the code together correctly. Our fiscal year starts Sept. 1-Aug 31. I
have to assign a payroll number to every piece of payroll information that
comes through my agency. These payroll numbers have to be numbered 1,2,3,and
so on and start over each Sept 1. (I would like the initial format of the
number to look like this: 09-1, 09-2, 09-3 where 09 is the fiscal year. I
have a table (tbl_payroll_no) with the following fields: ID (primary key),
payroll_no (text field), payroll_dt (text field). I have used the following
code to get the number to increment by 1:
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.NewRecord Then
Me.payroll_no = Nz(DMax("[payroll_no]", "tbl_payroll_no")) + 1
End If
End Sub
But for the life of me, I cannot figure out how to make the number start
over each September.
Any suggestion would greatly be appreciated.
piece the code together correctly. Our fiscal year starts Sept. 1-Aug 31. I
have to assign a payroll number to every piece of payroll information that
comes through my agency. These payroll numbers have to be numbered 1,2,3,and
so on and start over each Sept 1. (I would like the initial format of the
number to look like this: 09-1, 09-2, 09-3 where 09 is the fiscal year. I
have a table (tbl_payroll_no) with the following fields: ID (primary key),
payroll_no (text field), payroll_dt (text field). I have used the following
code to get the number to increment by 1:
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.NewRecord Then
Me.payroll_no = Nz(DMax("[payroll_no]", "tbl_payroll_no")) + 1
End If
End Sub
But for the life of me, I cannot figure out how to make the number start
over each September.
Any suggestion would greatly be appreciated.