bob bisquick
Registered User.
- Local time
- Today, 15:56
- Joined
- Nov 8, 2002
- Messages
- 37
I am building a database that is geared towards running a report with some totals of the information in a seperate database. I have created all my queries. They all work. I have created my report. It works. Now I am making a form where the user enters dates to limit the data included in the report. The dates are stored as global functions. Here is the code associated with my form:
Private Sub Run_Report_Click()
On Error GoTo Err_Run_Report_Click
Dim stDocName As String
'Set Date Range
If IsNull([Start_Date]) Or IsNull([End_Date]) Then
MsgBox "Please Enter a Date Range"
Exit Sub
End If
Current_From_Date = Nz([Start_Date], "")
Current_To_Date = Nz([End_Date], "")
stDocName = "Monthly_Prison_Outreach_Report"
DoCmd.Close
DoCmd.OpenReport stDocName, acViewPreview
Exit_Run_Report_Click:
Exit Sub
Err_Run_Report_Click:
MsgBox Err.Description
Resume Exit_Run_Report_Click
End Sub
When I enter the dates and then click the OK button on my form (called Run_Report) I get the following message:
Microsoft Access can't find the field "|" referred to in your expression.
Now, I have never referred to "|" anywhere in the database, so I don't even know how to troubleshoot because I don't know what the hell it's talking about.
Private Sub Run_Report_Click()
On Error GoTo Err_Run_Report_Click
Dim stDocName As String
'Set Date Range
If IsNull([Start_Date]) Or IsNull([End_Date]) Then
MsgBox "Please Enter a Date Range"
Exit Sub
End If
Current_From_Date = Nz([Start_Date], "")
Current_To_Date = Nz([End_Date], "")
stDocName = "Monthly_Prison_Outreach_Report"
DoCmd.Close
DoCmd.OpenReport stDocName, acViewPreview
Exit_Run_Report_Click:
Exit Sub
Err_Run_Report_Click:
MsgBox Err.Description
Resume Exit_Run_Report_Click
End Sub
When I enter the dates and then click the OK button on my form (called Run_Report) I get the following message:
Microsoft Access can't find the field "|" referred to in your expression.
Now, I have never referred to "|" anywhere in the database, so I don't even know how to troubleshoot because I don't know what the hell it's talking about.