By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,556 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.