hello
i m using the following code to show report
The problem is that when i entered the date for the same month, it shows the reuslt lik 01/10/2006 to 30/10/2006VB Code:
Public Sub ChkExpense() MdateQry = " BETWEEN #" & VBA.Format(Me.TxtFrom, "MM/DD/YYYY") & "# And #" & VBA.Format(Me.TxtTo, "MM/DD/YYYY") & "#" Set Rs = New ADODB.Recordset With Rs .Open "Select * from Tbl_Adjustment where Adj_Date" & MdateQry, Db, adOpenDynamic, adLockOptimistic Report.Database.SetDataSource Rs CRViewer1.ReportSource = Report ' Report.RecordSelectionFormula = "{Tbl_Payment_Receipt.Rec_No} = " & FrmRecovery.TxtNo & "" Report.FormulaFields.Item(1).Text = Chr(34) & TxtFrom.Text & Chr(34) Report.FormulaFields.Item(2).Text = Chr(34) & TxtTo.Text & Chr(34) StrSelectionFormula = "{Tbl_Adjustment.Adj_Date} in Date(" & _ Format(Me.TxtFrom, "yyyy,m,d") & ") to Date(" & _ Format(Me.TxtTo, "yyyy,m,d") & ")" Report.RecordSelectionFormula = StrSelectionFormula CRViewer1.ViewReport CRViewer1.Zoom 95 Report.DiscardSavedData End With End Sub
But when i entered the date between 2 months it shows nothing like
01/10/2006 to 10/11/2006
Whats wrong with this code. please help me.
Farooq


Reply With Quote


