pullingteeth
Programmer
I'm baffled by a bug which is happening; I have a report which is invoked by two different options on a form:
* If I select option #3, it works. If I select option #4, it doesn't work.
* I tried putting a "msgbox 'hi'" statement in the Report_Open() and Report_Activate() events; they don't show up in option #4 choices.
* If I run option #3 AFTER a failed option #4, the report is in the #4 format (i.e. it has a range of dates, although not exactly the range of dates that it should have.) Running option #3 again after this generates a normal #3 report.
* It is not the case that there are no results: a) I'm catching and dealing with the "empty report" error; b) if option #3's report has data for a particular date, then option #4's report should also have data.
Any ideas?
Thanks!
Code:
Case 3
If IsDate(Nz(Text21.value)) Then
DoCmd.OpenReport "detailed-summaryofevents", acViewPreview, , "thedate =#" _
& Text21.value & "#"
Else
MsgBox "Please enter a valid date", vbCritical
End If
Case 4
If IsDate(Nz(Text31.value)) Then
MsgBox "Calculating report. This will take a few seconds..."
DoCmd.OpenReport "detailed-summaryofevents", acViewPreview, , "thedate between #" _
& (Text31.value - 7) & "# and #" & Text31.value & "#"
Else
MsgBox "Please enter a valid date", vbCritical
End If
* If I select option #3, it works. If I select option #4, it doesn't work.
* I tried putting a "msgbox 'hi'" statement in the Report_Open() and Report_Activate() events; they don't show up in option #4 choices.
* If I run option #3 AFTER a failed option #4, the report is in the #4 format (i.e. it has a range of dates, although not exactly the range of dates that it should have.) Running option #3 again after this generates a normal #3 report.
* It is not the case that there are no results: a) I'm catching and dealing with the "empty report" error; b) if option #3's report has data for a particular date, then option #4's report should also have data.
Any ideas?
Thanks!