hi guys.. i got his Type mismatch error..Type mismatch: 'CLng' here's half the code...
If Trim(RstINVENCode(0)) = "123" Then INCode = ITEMCODE & "-" & YR & "0001" Else ICode = RstINVENCode(0) strIC = Mid(ICode,13,7) strcode = Mid(strIC, 3, 4) strcode = CLng(strcode) + 1 OLDYear = cstr(Mid(strIC, 1, 2)) if (clng(OLDYear)+1) = clng(YR) then strcode = "0001" strcode = Clng(strcode) end if
The error is in this code line: strcode = CLng(strcode) + 1Anyone willing to help?