B
BetHa
Hello,
The code below gives me an invoice number like: 20100301, 20100302, 20100302
etc...
I want to add a letter in front of it, like S-20100301, S-20100302,
S-20100302 etc...
Please can somebody help me out to change the code below?
TIA
Betha
Private Sub Form_BeforeInsert(Cancel As Integer)
Dim tNummer As String
tNummer = Format(Right(DatePart("yyyy", Date), 4), "0000") &
Format(DatePart("m", Date), "00") & "-"
If DCount("*", "Orders", "left(Factuurnr,7)= '" & tNummer & "'") = 0 Then
Me.Factuurnr = tNummer & "01"
Else
Me.Factuurnr = tNummer & Format(DMax("right(Factuurnr,2)", "Orders",
"left(Factuurnr,7)= '" & tNummer & "'") + 1, "00")
End If
End Sub
The code below gives me an invoice number like: 20100301, 20100302, 20100302
etc...
I want to add a letter in front of it, like S-20100301, S-20100302,
S-20100302 etc...
Please can somebody help me out to change the code below?
TIA
Betha
Private Sub Form_BeforeInsert(Cancel As Integer)
Dim tNummer As String
tNummer = Format(Right(DatePart("yyyy", Date), 4), "0000") &
Format(DatePart("m", Date), "00") & "-"
If DCount("*", "Orders", "left(Factuurnr,7)= '" & tNummer & "'") = 0 Then
Me.Factuurnr = tNummer & "01"
Else
Me.Factuurnr = tNummer & Format(DMax("right(Factuurnr,2)", "Orders",
"left(Factuurnr,7)= '" & tNummer & "'") + 1, "00")
End If
End Sub