0

Hello,
I want to generate reports between two dates. So i am using two DTPicker to select StartDate and EndDate. So I have written some code for it. But it is not working.

Private Sub cmdgenerate_Click()
Dim X As Variant
Dim Y As Variant
X = DTPickerstartdate.Value
Y = DTPickerenddate.Value

startdate = DateValue(DTPickerstartdate.Value)
enddate = DateValue(DTPickerenddate.Value)
   DTPickerstartdate.Value = str(startdate)
   DTPickerenddate.Value = str(enddate)
    var = (enddate - startdate)
    If var < 1 Then
        MsgBox "Choose proper dates", vbExclamation
    Else

DataEnvironment1.rptrenewal X, Y
rpt_renewal.Show
Unload DataEnvironment1
End If
Exit Sub
End Sub

I an having an error in DataEnvironment1.rptrenewal X, Y, as Wrong number of argument invalid property assignment. Please help me out.....

Edited by mike_2000_17: Fixed formatting

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by sumeetpingale
0

Thank you very much.. for helping me out..
But there is another problem for me.. How can i generate reports between specific dates? I am using two DTPicker's.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.