Custom Index

TurboDieselOne

Registered User.
Local time
Today, 23:31
Joined
Jan 16, 2003
Messages
39
I have this code on a button:-

Private Sub cmdCreateRefNo_Click()
Dim OurRef1 As String
Dim OurRef2 As String
Dim OurRef3 As String
OurRef1 = Year(Date)
OurRef2 = Month(Date)
OurRef3 = 1
If OurRef2 < 10 Then
OurRef2 = "0" + OurRef2
Else
OurRef2 = Month(Date)
End If
Me.txtOurRef = right(OurRef1, 2) + OurRef2 + OurRef3
End Sub

Now when Pressed it gives a result of 04061 now what I whant to do is make this number stored somewhere, aprt from in the field me.txtOurRef whis is a primary key so that I can create a 04062 when the button is pressed on a new record.

Any Ideas
 

Attachments

I think from the sound of it you could just store it in an unbound text box.
 

Users who are viewing this thread

Back
Top Bottom