Function that works second time
I have a function that works fine, but only the second time.I mean
with the first
click the report is opened blank, and just when i click second time,
the function is triggered and the report is opened properly.I cannot
explain myself why is it so, this is beyond me.
Since the function is working the second time, can i make it work
properly
with the first click ?
Dim strCriteria As String
Dim invoicedate As Control
Dim jan As String
Dim month As Control
Set month = Me![month]
Set invoicedate = Me![invoicedate]
jan = "Month(invoicedate)= 1 and year(invoicedate) = 2004"
Select Case month
Case 1
strCriteria = jan
End Select
Dim strDocName As String
strDocName = "rptMonths"
DoCmd.OpenReport strDocName, acPreview, , strCriteria