mrumar99
June 1st, 2005, 02:32 AM
hi all, i m using this code to display report of month selected from combo1
it shows records but only single of current month and moreover if there is no record of a month it shows previous result.
plz help me soon
bye
///////////
mon = Combo1.Text
cmd.CommandText = "Select * from travel"
rs2.Open cmd, , adOpenStatic, adLockReadOnly
Do While Not rs2.EOF
mo = Format(rs2.Fields("report_date"), "mmm")
If mo = mon Then
crxreport.RecordSelectionFormula = "{travel.travel_id} = " & rs2.Fields("travel_id")
CRViewer1.ReportSource = crxreport
End If
rs2.MoveNext
Loop
rs2.Close
CRViewer1.Zoom (100)
CRViewer1.ViewReport
it shows records but only single of current month and moreover if there is no record of a month it shows previous result.
plz help me soon
bye
///////////
mon = Combo1.Text
cmd.CommandText = "Select * from travel"
rs2.Open cmd, , adOpenStatic, adLockReadOnly
Do While Not rs2.EOF
mo = Format(rs2.Fields("report_date"), "mmm")
If mo = mon Then
crxreport.RecordSelectionFormula = "{travel.travel_id} = " & rs2.Fields("travel_id")
CRViewer1.ReportSource = crxreport
End If
rs2.MoveNext
Loop
rs2.Close
CRViewer1.Zoom (100)
CRViewer1.ViewReport