I keep getting a type mismatch problem at "Year(Now())" at the PrePressNumber line. Now shows up as a correct date/time, but the year(now()) gives me a type mismatch? What is going on???
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Get the maximum number from the MAIN table for the year
'and update that to the new value
Dim intNewVal As Integer
intNewVal = Nz(DMax("[NextSequence]", "Main", "Year = Year(Now())"), "0")
NextSequence = intNewVal
PrePressNumber = Right(Str(Year(Now())), 2) & "-" & intNewVal
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Get the maximum number from the MAIN table for the year
'and update that to the new value
Dim intNewVal As Integer
intNewVal = Nz(DMax("[NextSequence]", "Main", "Year = Year(Now())"), "0")
NextSequence = intNewVal
PrePressNumber = Right(Str(Year(Now())), 2) & "-" & intNewVal
End Sub