jamiecalvert
Registered User.
- Local time
- Today, 01:32
- Joined
- Jul 10, 2002
- Messages
- 10
I have a report based upon a query. I did have separate start & end date prompts for the date range for the report but after seeing a report dialogue form in Northwind & some example databases felt this would be more helpful to users. It has a Start & End date boxes & a preview key.
I set up the dialogue form & made sure the date parameters tied in with the query. In the query I have the following criteria:
>=[forms]![Report Date Range]![BeginDate] And <=[forms]![Report Date Range]![EndDate]
In the report I entered the follwing code for on 'Open', 'Close' & 'No data':
Option Compare Database
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Cancelling report..."
Cancel = -1
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "Report Date Range"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Written Business By Advisor Report"
If Not IsLoaded("Report Date Range") Then
Cancel = True
End If
End Sub
When I open the report I am being told there is a complie error and a Sub or Function not defined. 'IsLoaded' and 'Private Sub Report_Open(Cancel As Integer)' are highlighted.
Could someone advise where I am going wrong.
Thanks.
I set up the dialogue form & made sure the date parameters tied in with the query. In the query I have the following criteria:
>=[forms]![Report Date Range]![BeginDate] And <=[forms]![Report Date Range]![EndDate]
In the report I entered the follwing code for on 'Open', 'Close' & 'No data':
Option Compare Database
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Cancelling report..."
Cancel = -1
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "Report Date Range"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Written Business By Advisor Report"
If Not IsLoaded("Report Date Range") Then
Cancel = True
End If
End Sub
When I open the report I am being told there is a complie error and a Sub or Function not defined. 'IsLoaded' and 'Private Sub Report_Open(Cancel As Integer)' are highlighted.
Could someone advise where I am going wrong.
Thanks.