Plz help me with this code
Private Sub cmdGenRep_Click()
On Error GoTo errhandler
fdt = dtpFdate.Value
tdt = dtpTdate.Value
If cmboCountry(1).Text <> "-- Select Country --" Then
country = cmboCountry(0).Text
ElseIf cmboCountry(1).Text = "-- Select Country --" Then
MsgBox "Please Select Country", vbInformation, "Message"
cmboCountry(1).SetFocus
Exit Sub
End If
Call openStudent_Master
Set rsRep = New ADODB.Recordset
MsgBox dtpFdate.Value
MsgBox dtpTdate.Value
' str = "select stu_id,fname,lname,Con_Resi_stdcode,Con_Resi_no,Co n_Mo,course_preferred,comments from Student_Master where reminder BETWEEN " + dtpFdate.Value + " and " + dtpTdate.Value
str = "select stu_id,fname,lname,Con_Resi_stdcode,Con_Resi_no,Co n_Mo,course_preferred,comments from Student_Master where reminder > '" & dtpFdate.Value & "' and reminder < '" & dtpTdate.Value & "'"
MsgBox str
rsRep.Open str, cn, adOpenStatic, adLockReadOnly
Set drVA.DataSource = rsRep
errhandler:
MsgBox Err.Description
MsgBox Err.Number
End Sub
|