Guys unsa problema ani
Run time error '-2147217900(80040e14)':
undefined function 'substr' in expression in vb6
mS access ako gamit.
here is the code:
Function GetLastLevel(StudID As String, SY As String) As Integer
Dim rs As New ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "SELECT YearLevel FROM tblEnrollment INNER JOIN tblLevel ON tblLevel.LevelID=tblEnrollment.LevelID WHERE StudentID='" & StudID & "' AND SUBSTR(SchoolYear,1,4)<'" & SY & "' ORDER BY EnrollID DESC", cn, adOpenDynamic, adLockOptimistic
If Not rs.EOF Then
GetLastLevel = rs!YearLevel
Else
GetLastLevel = 0
End If
rs.Close
End Function
hope to hhave a response here.
ty