everyone...
I am having problem with this code:
I would like to print records from a single table whose year = sort and academic_year = ag...HTML Code:Private Sub lvButtons_H6_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim ag As String Call dbConek If Text4 = "" Or Text3 = "" Then MsgBox "Kindly Input the Academic Year", vbOKOnly, "Error in Printing" Text4.SetFocus Else ag = Text5.Text & "-" & Text6.Text With ar .Open "SHAPE {SELECT * FROM `Student_Masterlist`} AS Student_Masterlist APPEND ({select * from Student_Masterlist order by stud_idnum} AS Command1 RELATE 'year = '" & sort & " ' TO 'Academic_Year= '" & ag & "'') AS Command1", strConek, adOpenStatic, adLockOptimistic If .RecordCount = 0 Then MsgBox "No record found.", vbExclamation Else Set DataReport5.DataSource = ar DataReport5.Show End If End With End If End Sub
Thanks




Reply With Quote