473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Runtime Error 2465: can't find the field "|" refered to in your expression

PW
Hi,

What the heck is that supposed to mean? I am getting this error on a
"Me.Requery" line in a subroutine on a form, but only when I select
something from a combo/dropdown box. The *exact* same code is run when
I do other things (like press the Save button or tab through that
control).

I have searched every control, involved queries and tables and I can't
find anything that looks fishy.

Any ideas?

-pw

Dec 5 '06 #1
2 14221
Good night, Paul! This could be several things.

What event are you doing this in? A requery could trigger a chain of events
that actually fails somewhere. For example, if you are doing this in the
KeyDown event of a text box, Access has to trigger the controls' Change,
BeforeUpdate and AfterUpdate events, and the BeforeUpdate event of the form
before it can save the record before it can perform the requery, which will
trigger the form's Current event, and probably the Exit and Enter events of
the controls. If anything at all fails in that chain, the message gets
passed back up the chain and you often get a weirdly inappropriate message
as a result.

To avoid the problem, you may need to move the code into a more appropriate
event. I find it also helps to pin down where the error really lies if you
explicitly save the record first, e.g.
If Me.Dirty Then Me.Dirty = False

Another possible cause of Access's confusion about the names of things is
Name AutoCorrect. Disable it, and compact the database. More info:
http://allenbrowne.com/bug-03.html

Another possible trigger is the kind of corruption that a decompile fixes.
To decompile, make a backup of the database, and enter something like this
at the command prompt while Access is not running. It is all one line, and
include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

Removing unnecessary references, and using Option Explicit can also help to
track down the cause.

There is also a bug that triggers this error if you are adding a new record
in a form that is based on a multi-table query some fields of the table you
are not adding a record to have a Default Value specified.

Hope that helps you to pin it down.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"PW" <pa********@removewilliamsonenterprises.comwrote in message
news:o5********************************@4ax.com...
>
What the heck is that supposed to mean? I am getting this error on a
"Me.Requery" line in a subroutine on a form, but only when I select
something from a combo/dropdown box. The *exact* same code is run when
I do other things (like press the Save button or tab through that
control).

I have searched every control, involved queries and tables and I can't
find anything that looks fishy.

Any ideas?

-pw

Dec 6 '06 #2
PW
On Wed, 6 Dec 2006 12:05:13 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>Good night, Paul! This could be several things.

What event are you doing this in? A requery could trigger a chain of events
that actually fails somewhere. For example, if you are doing this in the
KeyDown event of a text box, Access has to trigger the controls' Change,
BeforeUpdate and AfterUpdate events, and the BeforeUpdate event of the form
before it can save the record before it can perform the requery, which will
trigger the form's Current event, and probably the Exit and Enter events of
the controls. If anything at all fails in that chain, the message gets
passed back up the chain and you often get a weirdly inappropriate message
as a result.

To avoid the problem, you may need to move the code into a more appropriate
event. I find it also helps to pin down where the error really lies if you
explicitly save the record first, e.g.
If Me.Dirty Then Me.Dirty = False

Another possible cause of Access's confusion about the names of things is
Name AutoCorrect. Disable it, and compact the database. More info:
http://allenbrowne.com/bug-03.html

Another possible trigger is the kind of corruption that a decompile fixes.
To decompile, make a backup of the database, and enter something like this
at the command prompt while Access is not running. It is all one line, and
include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

Removing unnecessary references, and using Option Explicit can also help to
track down the cause.

There is also a bug that triggers this error if you are adding a new record
in a form that is based on a multi-table query some fields of the table you
are not adding a record to have a Default Value specified.

Hope that helps you to pin it down.

Good stuff Allen! I discovered that when I selected something from
the SoldBy combobox I was also saving the record on the Exit event of
the combobox (so I was saving it twice). I also received a couple
other "whacko" error message but I think I've fixed it!

-paul
Dec 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JMCN | last post by:
hello i receive a runtime error '2465' whenever i run my module in access 97. it says 'Run-time error '2465' OOB Reports can't find the field "DuplicatePayments' referred to in your...
5
by: Lyn | last post by:
Hi, this has been driving me nuts. I'm on Office 2003 SP1, Win XP SP1. I am opening a form with a number of subforms based on various tables. The subforms are populated via the main form's...
6
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order...
3
by: MIG | last post by:
I had a form which used year(date) to compare an input value with the year of today's date. This was working fine. Now, for some reason, I am getting run-time error 2465 "Library Catalogue...
6
by: MLH | last post by:
"The following unexpected error occurred in Sub CopyMySQLbttn_Click, line #250, CBF on frmVehicleChooserform. 2465: "Can't find the field 'forms' referred to in your expression. You may have...
7
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter,...
6
imrosie
by: imrosie | last post by:
hello experts, Im a newbie in need of someone's experience. I have an image repository db that allows the input and search images just fine. However, if I want to erase an image, the subroutine...
4
kcdoell
by: kcdoell | last post by:
Hello: I have the following afterupdate event: Private Sub GWP_AfterUpdate() 'Updates the Total calculation in the control "SumGWP" on the quick reference 'table that is located on the form...
2
by: zufie | last post by:
I have an Option GROUP which produces 6 different report between two dates. A separate Option BUTTON determines the period of the report once I enter the From & To Dates into the textboxes. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.