Adding 1 to (text) Unique Id

lcook1974

Registered User.
Local time
Today, 17:27
Joined
Dec 21, 2007
Messages
330
Hey,
I'm using Access 2007 and need to figure out a way to add 1 increment to a text field. I have an ID as an autonumber but for these purposes we have to enter a "Tissue Id" like this T11-1109...so the next one would be T11-1110 and so on...

Is there a way I could auto format it like this?

T(year) - 1110

so next year it would automatically change to T12-0001 etc...

Any help would be great!
Links, blogs or previous threads would be great start for me.

Larry
 
I have a query that will pull the "Max Tissue Id" on the form

I thinking it needs to be formatted like below..(ex: MaxTissueId = T11-0001)

"T" & Format(Year(Now()),"YY") & "-" & Me.MaxTissueId + 1
 
Got it sorted...

Private Sub Command5_Click()
If Me.txtNewId = Me.txtCheckId Then
MsgBox "Success"
Else
MsgBox "No success"
End If
End Sub
Private Sub Form_Load()
Dim NewNum As Variant
NewNum = Split(Me.MaxOfTissueId, "-")(1) + 1
Me.txtNewId = "T" & Format(Now(), "YY") & "-" & NewNum


End Sub
 

Users who are viewing this thread

Back
Top Bottom