Question Reseting a number based on new year and another criteria

joannk

New member
Local time
Yesterday, 21:52
Joined
Jan 14, 2012
Messages
3
Hello, all

I am setting up a database that maintains permits issued. I want to be able to created a permit no. based on the year issued and the township. my permit id no is setup as follows: ex 2012bu-1 with the first 4 being the year the second a township code and the last the current number for the perimit issued. I did find the thread on resetting based on the year and have that working but I also need it to number based on the township and resetting each year

Examples for the year

2012BU-01
2012WP-01
2012BU-02
2012BU-03
2012WP-02
etc.

So every year the the -xx would reset based on the year and the township code. I have no idea what to do to get it number based on the township after the year is reset. I am attaching my database so that you can see what I have so far. Any help would be greatly appreciated.

J.
 

Attachments

Thanks, I actually fiquired out.... I used the following

Private Sub Save_Click()
If IsNull(Me![Number]) Then
Me![Number] = Format(Nz(DMax("[Number]", "[UCCPermit]", "Year([Date1])= " & Year(Me.Date1) & " AND " & "[ts code]= '" & Me.[TS Code] & "'"), 0) + 1)
End If
Me![PermitNo] = Format([Date1], "yy") & [TS Code] & "-" & Format([Number], "000")
Me.Refresh
End Sub

Thank you again for replying and helping.
 
Thank you for posting back with your success and solution.
 

Users who are viewing this thread

Back
Top Bottom