D
dan.cawthorne
Hi All,
A Few Months ago i had some help and creating some code that
automatically generated a number for each project which was recieved,
its been working fine untill We hit the Year 2008,
The Code Made up a Value for example
Q586707
Q586807
Q586907 < Last Number for 2007
The Code Then Was Suppose to Start the first number off as
Q000108
which it did, and no when i open the wizard i created it keeps
generating that number its not moving up to Q000208
and you see the number is made up of 2 parts Q0000 08
Heres the code and its on the forms Current Event Procedure
Private Sub Form_Current()
If Me.NewRecord Then
If Format((Date), "yy") <> Right( _
DMax("ProjectQNo", "tbl_Projects"), 2) Then
Me!ProjectQNo = "Q0001" & Format((Date), "yy")
Else
Me![ProjectQNo] = "Q" & _
Mid(DMax("ProjectQNo", "tbl_Projects"), 2, 4) + 1 & _
Format((Date), "yy")
End If
End If
End Sub
Whats wrong with the code?
A Few Months ago i had some help and creating some code that
automatically generated a number for each project which was recieved,
its been working fine untill We hit the Year 2008,
The Code Made up a Value for example
Q586707
Q586807
Q586907 < Last Number for 2007
The Code Then Was Suppose to Start the first number off as
Q000108
which it did, and no when i open the wizard i created it keeps
generating that number its not moving up to Q000208
and you see the number is made up of 2 parts Q0000 08
Heres the code and its on the forms Current Event Procedure
Private Sub Form_Current()
If Me.NewRecord Then
If Format((Date), "yy") <> Right( _
DMax("ProjectQNo", "tbl_Projects"), 2) Then
Me!ProjectQNo = "Q0001" & Format((Date), "yy")
Else
Me![ProjectQNo] = "Q" & _
Mid(DMax("ProjectQNo", "tbl_Projects"), 2, 4) + 1 & _
Format((Date), "yy")
End If
End If
End Sub
Whats wrong with the code?