The application has a screen that offers three choices. When the second or third choice is selected, the event procedure kicks off a query that receives a date field from the screen. there are two different date fields to coordinate with the user's selection.
the code has a temp field that receives the date value and passes it to a query. when the second choice is selected, the query runs without errors. when the third choice is selected, the following error code is generated:
[2465] Mircosoft Access cant find the field '|" referred to in your expression"
when the query has the parameter removed, no error is generated. again, what is brothersome, it basically runs the same code for the second selection, and generates an error on the third run.
the entire code is as follows:
-
-
Option Compare Database
-
-
-
Private Sub Contract_Mgt_Rpt_by_Contract_Status_Click()
-
-
On Error GoTo Err_Hndlr
-
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter.Visible = True
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter.Visible = False
-
stDocName = "R_Contract_Status"
-
-
-
Exit_Contract_Mgt_Rpt_by_Contract_Status_Click:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Contract_Mgt_Rpt_by_Contract_Status_Click()"
-
-
End Sub
-
-
Private Sub Expire_Date_Rpt_Parameter_AfterUpdate()
-
-
On Error GoTo Err_Hndlr
-
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter
-
DoCmd.OpenReport stDocName, acPreview
-
-
-
Exit_Expire_Date_Rpt_Parameter_AfterUpdate:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Rpt_Parameter_AfterUpdate()"
-
End Sub
-
-
Private Sub Expire_Date_Rpt_Parameter_Enter()
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
-
-
Exit_Expire_Date_Rpt_Parameter_Enter:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Rpt_Parameter_Enter()"
-
-
End Sub
-
-
Private Sub Expire_Date_Qry_Parameter_AfterUpdate()
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter
-
DoCmd.OutputTo acOutputQuery, stDocName, [Excel 97 - Excel 2003 Workbook (*.xls)], AutoStart
-
-
MsgBox "Task Complete!"
-
-
-
Exit_Expire_Date_Qry_Parameter_AfterUpdate:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_AfterUpdate()"
-
End Sub
-
-
Private Sub Expire_Date_Qry_Parameter_Enter()
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter = Null
-
-
Exit_Expire_Date_Qry_Parameter_Enter:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Expire_Date_Qry_Parameter_Enter()"
-
End Sub
-
-
Private Sub ExportContractData_Click()
-
-
On Error GoTo Err_Hndlr
-
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Temp_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter = Null
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Rpt_Parameter.Visible = False
-
Forms!F_Contract_Mgt_Entry!Expire_Date_Qry_Parameter.Visible = True
-
stDocName = "Q_2_Recs_<_ExpireDateParameter"
-
-
Exit_ExportContractData_Click:
-
Exit Sub
-
-
Err_Hndlr:
-
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "ExportContractData_Click()"
-
End Sub
-
-
-