What's causing error 2465?

L

Lars Brownies

A user gets error 2465: "Can't find field | which is being refered to in the
expression".
The error is generated in the following function but the user and I can't
reproduce it. The function seems to work fine.
Any idea what might cause this error?

Thanks,

Lars


Function fFilterRequest(intChoice)
Dim rs As DAO.Recordset
On Error GoTo Err_Handler

With Forms!frmRequest
Select Case intChoice:
Case 1: .Form.Filter = "Editor =""" & !fldUser & """" & " AND
Date_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending this employee"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "This employee has no pending requests."
End If
Set rs = Nothing
Case 2: .Form.Filter = "Datum_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending all"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "No pending requests."
End If
End Select
End With

Exit_this_function: Exit Function
Err_Handler:
Dim strError As String
strError = "Error: " & Err.Number & ": " & Err.Description
MsgBox strError: Call ErrorLog("Generic", "fFilterRequest", strError)
Resume Exit_this_function
End Function
 
G

Graham Mandeno

Hi Lars

Have you tried commenting out your "On Error GoTo" line?

That way, if the error is occurring in that function, the code execution
should break at the offending line.

Incidentally, I don't think it is causing the problem, but the .Form in
front of .Filter and .FilterOn is redundant, because Forms!frmRequest is
already a Form object.

Also, Forms!frmRequest.Recordset can be replaced by .Recordset, because you
are within the With block.
 
L

Lars Brownies

Thanks for the tips. I adjusted the form references.
Commenting out the 'on error goto' line is not an option since this is an
MDE and I can't reproduce the error.

Lars.

Graham Mandeno said:
Hi Lars

Have you tried commenting out your "On Error GoTo" line?

That way, if the error is occurring in that function, the code execution
should break at the offending line.

Incidentally, I don't think it is causing the problem, but the .Form in
front of .Filter and .FilterOn is redundant, because Forms!frmRequest is
already a Form object.

Also, Forms!frmRequest.Recordset can be replaced by .Recordset, because
you are within the With block.
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Lars Brownies said:
A user gets error 2465: "Can't find field | which is being refered to in
the expression".
The error is generated in the following function but the user and I can't
reproduce it. The function seems to work fine.
Any idea what might cause this error?

Thanks,

Lars


Function fFilterRequest(intChoice)
Dim rs As DAO.Recordset
On Error GoTo Err_Handler

With Forms!frmRequest
Select Case intChoice:
Case 1: .Form.Filter = "Editor =""" & !fldUser & """" & " AND
Date_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending this employee"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "This employee has no pending requests."
End If
Set rs = Nothing
Case 2: .Form.Filter = "Datum_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending all"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "No pending requests."
End If
End Select
End With

Exit_this_function: Exit Function
Err_Handler:
Dim strError As String
strError = "Error: " & Err.Number & ": " & Err.Description
MsgBox strError: Call ErrorLog("Generic", "fFilterRequest", strError)
Resume Exit_this_function
End Function
 
G

Graham Mandeno

Hi Lars

Is the error still occurring, but only in the MDE?

One way to track down the line causing the error is to add line numbers to
every line in the procedure, then include Erl (the error line) in your error
message.

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Lars Brownies said:
Thanks for the tips. I adjusted the form references.
Commenting out the 'on error goto' line is not an option since this is an
MDE and I can't reproduce the error.

Lars.

Graham Mandeno said:
Hi Lars

Have you tried commenting out your "On Error GoTo" line?

That way, if the error is occurring in that function, the code execution
should break at the offending line.

Incidentally, I don't think it is causing the problem, but the .Form in
front of .Filter and .FilterOn is redundant, because Forms!frmRequest is
already a Form object.

Also, Forms!frmRequest.Recordset can be replaced by .Recordset, because
you are within the With block.
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Lars Brownies said:
A user gets error 2465: "Can't find field | which is being refered to in
the expression".
The error is generated in the following function but the user and I
can't reproduce it. The function seems to work fine.
Any idea what might cause this error?

Thanks,

Lars


Function fFilterRequest(intChoice)
Dim rs As DAO.Recordset
On Error GoTo Err_Handler

With Forms!frmRequest
Select Case intChoice:
Case 1: .Form.Filter = "Editor =""" & !fldUser & """" & " AND
Date_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending this employee"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "This employee has no pending requests."
End If
Set rs = Nothing
Case 2: .Form.Filter = "Datum_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending all"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "No pending requests."
End If
End Select
End With

Exit_this_function: Exit Function
Err_Handler:
Dim strError As String
strError = "Error: " & Err.Number & ": " & Err.Description
MsgBox strError: Call ErrorLog("Generic", "fFilterRequest", strError)
Resume Exit_this_function
End Function
 
L

Lars Brownies

"Unfortunately" the error hasn't appeared anymore.
I'll add the line numbers. Thanks for the tip.

Lars

Graham Mandeno said:
Hi Lars

Is the error still occurring, but only in the MDE?

One way to track down the line causing the error is to add line numbers to
every line in the procedure, then include Erl (the error line) in your
error message.

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Lars Brownies said:
Thanks for the tips. I adjusted the form references.
Commenting out the 'on error goto' line is not an option since this is an
MDE and I can't reproduce the error.

Lars.

Graham Mandeno said:
Hi Lars

Have you tried commenting out your "On Error GoTo" line?

That way, if the error is occurring in that function, the code execution
should break at the offending line.

Incidentally, I don't think it is causing the problem, but the .Form in
front of .Filter and .FilterOn is redundant, because Forms!frmRequest is
already a Form object.

Also, Forms!frmRequest.Recordset can be replaced by .Recordset, because
you are within the With block.
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

A user gets error 2465: "Can't find field | which is being refered to in
the expression".
The error is generated in the following function but the user and I
can't reproduce it. The function seems to work fine.
Any idea what might cause this error?

Thanks,

Lars


Function fFilterRequest(intChoice)
Dim rs As DAO.Recordset
On Error GoTo Err_Handler

With Forms!frmRequest
Select Case intChoice:
Case 1: .Form.Filter = "Editor =""" & !fldUser & """" & " AND
Date_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending this employee"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "This employee has no pending requests."
End If
Set rs = Nothing
Case 2: .Form.Filter = "Datum_Ready IS NULL"
.Form.FilterOn = True
!cmbView = "Pending all"
.OrderBy = "ID_request"
.OrderByOn = True
Set rs = Forms!frmRequest.Recordset
If rs.RecordCount > 0 Then
rs.MoveLast
Else
MsgBox "No pending requests."
End If
End Select
End With

Exit_this_function: Exit Function
Err_Handler:
Dim strError As String
strError = "Error: " & Err.Number & ": " & Err.Description
MsgBox strError: Call ErrorLog("Generic", "fFilterRequest",
strError)
Resume Exit_this_function
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top