Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Job_Date_AfterUpdate()
dim maxRef as string, maxID As Integer
dim codeDate as string, maxDate as string
codeDate = format( [b]date[/b], "MMYY")
maxRef = dmax( [b]"Ref"[/b], "Job" ) 'get last ref
maxDate = left(maxRef,4) 'get date code
if( maxdate < codeDate ) then 'test for new month
maxID = 0 'reset id to 0
else
maxID = CInt(right(maxRef, 4)) 'convert to int
end if
Me.ref = codeDate & format(maxID + 1, "0000")
End Sub