Run-time error '2465' when performing Requery in a form


C

Chuck Chopp

I have a form in an Access 2000 database application that calls a macro when
the On Activate event occurs. This macro simply performs the Requery action
and does not specify any object/control name in the parameter which should
result in the data source for the form [a query] being refreshed.
Previously, this worked w/o any problems at all. Recently, some changes
were made to record definitions [added some new fields] in some of the
tables [these are linked tables in a .MDB file that is separate from the one
that the forms, macros & modules exist in], but no changes were made that
should have affected the query. I didn't rename any existing fields.

Anyway, whenever the macro is executed, a message box is displayed as follows:

Title = "Action failed"

The macro name, a condition value of "True", an action name of "Requery" and
an empty string for "Arguments" are all displayed in the message box.

The only button that isn't disabled is "Halt".

When I click on the "Halt" button, the macro is halted and then the form
displays itself and it appears that all of the records [this is a master
record form] are displayed on the form. If I give focus to a different form
and then return to this form again, the On Activate event occurs again and
the same message box is displayed again.

Next, I replaced the macro that uses the Requery action with a VB event
procedure that calls the Requery method for the form. I simply use
"Me.Requery" in the event procedure. I am still getting an error when the
requery is performed, but the message is slightly more informative and
appears as follows:

Message box title = "Microsoft Visual Basic"
Message box text is as follows:

Run-time error '2465':
CDM Update Database can't find the field "|" referred to in your
expression.

The enabled buttons are "End", "Debug" and "Help".


I've reviewed the query object that the form uses as a data source [in
design view and in SQL view] and I cannot find any occurrences of a field
named "|" being used at all. I have also gone through and verified every
single field and control reference in the form itself and in the main form
that opens this master record form and, again, no typos were found.

I reviewed various postings found via Google but I didn't find anything in
particular to solve this problem.

Any ideas what might be going wrong?


TIA,

Chuck
--
Chuck Chopp

ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com
ICQ # 22321532
RTFM Consulting Services Inc. 864 801 2795 voice & voicemail
103 Autumn Hill Road 864 801 2774 fax
Greer, SC 29651 800 774 0718 pager
8007740718 (at) skytel (dot) com

Do not send me unsolicited commercial email.
 
Ad

Advertisements

A

Allen Browne

Hi Chuck.

The pipe character in error message 2465 is a place holder for the field
name. Clearly Access is unable to identify what field is is talking about.

The most likely cause is a fault in how Access is tracking its "Name
AutoCorrect" feature. See if this solves the problem:
1. Compact your database (Tools | Database Utilities | Compact).

2. Create a new (blank) database.

3. In the new database, uncheck the Name Correct boxes under:
Tools | Options | General.

4. Import all objects from your problem database except for the linked
tables:
File | Get External | Import.

5. Attach the linked tables from your back end file:
File | Get External | Link.

Hopefully that will get you going.


More info on Name AutoCorrect:
The feature does not work properly with:
- queries (230723, 247488, 256101, 282322),
- forms (230741, 275063),
- reports (231634, 240826).
It does not work at all with macros, modules, and DAPs.
It fails with converted databases (230616), and imported objects (231676).
It messes up design-time licences (824165).
It is a serious performance problem (200600, 290181).
It causes Access to crash (322794, 319491), therefore corrupting databases.

To view the articles referred to above, use:
http://support.microsoft.com/?id=KBnumberhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chuck Chopp said:
I have a form in an Access 2000 database application that calls a macro when
the On Activate event occurs. This macro simply performs the Requery action
and does not specify any object/control name in the parameter which should
result in the data source for the form [a query] being refreshed.
Previously, this worked w/o any problems at all. Recently, some changes
were made to record definitions [added some new fields] in some of the
tables [these are linked tables in a .MDB file that is separate from the one
that the forms, macros & modules exist in], but no changes were made that
should have affected the query. I didn't rename any existing fields.

Anyway, whenever the macro is executed, a message box is displayed as follows:

Title = "Action failed"

The macro name, a condition value of "True", an action name of "Requery" and
an empty string for "Arguments" are all displayed in the message box.

The only button that isn't disabled is "Halt".

When I click on the "Halt" button, the macro is halted and then the form
displays itself and it appears that all of the records [this is a master
record form] are displayed on the form. If I give focus to a different form
and then return to this form again, the On Activate event occurs again and
the same message box is displayed again.

Next, I replaced the macro that uses the Requery action with a VB event
procedure that calls the Requery method for the form. I simply use
"Me.Requery" in the event procedure. I am still getting an error when the
requery is performed, but the message is slightly more informative and
appears as follows:

Message box title = "Microsoft Visual Basic"
Message box text is as follows:

Run-time error '2465':
CDM Update Database can't find the field "|" referred to in your
expression.

The enabled buttons are "End", "Debug" and "Help".


I've reviewed the query object that the form uses as a data source [in
design view and in SQL view] and I cannot find any occurrences of a field
named "|" being used at all. I have also gone through and verified every
single field and control reference in the form itself and in the main form
that opens this master record form and, again, no typos were found.

I reviewed various postings found via Google but I didn't find anything in
particular to solve this problem.

Any ideas what might be going wrong?
 
G

Gary Miller

Allen,

Just for my curiousity, with all of the issues on this, are
you aware why this hasn't been addressed and corrected in
the Service Packs?
--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Allen Browne said:
Hi Chuck.

The pipe character in error message 2465 is a place holder for the field
name. Clearly Access is unable to identify what field is is talking about.

The most likely cause is a fault in how Access is tracking its "Name
AutoCorrect" feature. See if this solves the problem:
1. Compact your database (Tools | Database Utilities | Compact).

2. Create a new (blank) database.

3. In the new database, uncheck the Name Correct boxes under:
Tools | Options | General.

4. Import all objects from your problem database except for the linked
tables:
File | Get External | Import.

5. Attach the linked tables from your back end file:
File | Get External | Link.

Hopefully that will get you going.


More info on Name AutoCorrect:
The feature does not work properly with:
- queries (230723, 247488, 256101, 282322),
- forms (230741, 275063),
- reports (231634, 240826).
It does not work at all with macros, modules, and DAPs.
It fails with converted databases (230616), and imported objects (231676).
It messes up design-time licences (824165).
It is a serious performance problem (200600, 290181).
It causes Access to crash (322794, 319491), therefore corrupting databases.

To view the articles referred to above, use:
http://support.microsoft.com/?id=KBnumberhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chuck Chopp said:
I have a form in an Access 2000 database application
that calls a macro
when
the On Activate event occurs. This macro simply
performs the Requery
action
and does not specify any object/control name in the parameter which should
result in the data source for the form [a query] being refreshed.
Previously, this worked w/o any problems at all. Recently, some changes
were made to record definitions [added some new fields] in some of the
tables [these are linked tables in a .MDB file that is
separate from the
one
that the forms, macros & modules exist in], but no changes were made that
should have affected the query. I didn't rename any existing fields.

Anyway, whenever the macro is executed, a message box is
displayed as
follows:
Title = "Action failed"

The macro name, a condition value of "True", an action
name of "Requery"
and
an empty string for "Arguments" are all displayed in the message box.

The only button that isn't disabled is "Halt".

When I click on the "Halt" button, the macro is halted and then the form
displays itself and it appears that all of the records [this is a master
record form] are displayed on the form. If I give focus
to a different
form
and then return to this form again, the On Activate event occurs again and
the same message box is displayed again.

Next, I replaced the macro that uses the Requery action with a VB event
procedure that calls the Requery method for the form. I simply use
"Me.Requery" in the event procedure. I am still getting an error when the
requery is performed, but the message is slightly more informative and
appears as follows:

Message box title = "Microsoft Visual Basic"
Message box text is as follows:

Run-time error '2465':
CDM Update Database can't find the field "|" referred to in your
expression.

The enabled buttons are "End", "Debug" and "Help".


I've reviewed the query object that the form uses as a data source [in
design view and in SQL view] and I cannot find any occurrences of a field
named "|" being used at all. I have also gone through and verified every
single field and control reference in the form itself and in the main form
that opens this master record form and, again, no typos were found.

I reviewed various postings found via Google but I didn't find anything in
particular to solve this problem.

Any ideas what might be going wrong?
 
A

Allen Browne

Some of the issues have been addressed. It's just that it's such a bad
feature with so many different issues that you are better to avoid it
completely.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Gary Miller said:
Allen,

Just for my curiousity, with all of the issues on this, are
you aware why this hasn't been addressed and corrected in
the Service Packs?
--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Allen Browne said:
Hi Chuck.

The pipe character in error message 2465 is a place holder for the field
name. Clearly Access is unable to identify what field is is talking about.

The most likely cause is a fault in how Access is tracking its "Name
AutoCorrect" feature. See if this solves the problem:
1. Compact your database (Tools | Database Utilities | Compact).

2. Create a new (blank) database.

3. In the new database, uncheck the Name Correct boxes under:
Tools | Options | General.

4. Import all objects from your problem database except for the linked
tables:
File | Get External | Import.

5. Attach the linked tables from your back end file:
File | Get External | Link.

Hopefully that will get you going.


More info on Name AutoCorrect:
The feature does not work properly with:
- queries (230723, 247488, 256101, 282322),
- forms (230741, 275063),
- reports (231634, 240826).
It does not work at all with macros, modules, and DAPs.
It fails with converted databases (230616), and imported objects (231676).
It messes up design-time licences (824165).
It is a serious performance problem (200600, 290181).
It causes Access to crash (322794, 319491), therefore corrupting databases.

To view the articles referred to above, use:
http://support.microsoft.com/?id=KBnumberhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chuck Chopp said:
I have a form in an Access 2000 database application
that calls a macro
when
the On Activate event occurs. This macro simply
performs the Requery
action
and does not specify any object/control name in the parameter which should
result in the data source for the form [a query] being refreshed.
Previously, this worked w/o any problems at all. Recently, some changes
were made to record definitions [added some new fields] in some of the
tables [these are linked tables in a .MDB file that is
separate from the
one
that the forms, macros & modules exist in], but no changes were made that
should have affected the query. I didn't rename any existing fields.

Anyway, whenever the macro is executed, a message box is
displayed as
follows:
Title = "Action failed"

The macro name, a condition value of "True", an action
name of "Requery"
and
an empty string for "Arguments" are all displayed in the message box.

The only button that isn't disabled is "Halt".

When I click on the "Halt" button, the macro is halted and then the form
displays itself and it appears that all of the records [this is a master
record form] are displayed on the form. If I give focus
to a different
form
and then return to this form again, the On Activate event occurs again and
the same message box is displayed again.

Next, I replaced the macro that uses the Requery action with a VB event
procedure that calls the Requery method for the form. I simply use
"Me.Requery" in the event procedure. I am still getting an error when the
requery is performed, but the message is slightly more informative and
appears as follows:

Message box title = "Microsoft Visual Basic"
Message box text is as follows:

Run-time error '2465':
CDM Update Database can't find the field "|" referred to in your
expression.

The enabled buttons are "End", "Debug" and "Help".


I've reviewed the query object that the form uses as a data source [in
design view and in SQL view] and I cannot find any occurrences of a field
named "|" being used at all. I have also gone through and verified every
single field and control reference in the form itself and in the main form
that opens this master record form and, again, no typos were found.

I reviewed various postings found via Google but I didn't find anything in
particular to solve this problem.

Any ideas what might be going wrong?
 
C

Chuck Chopp

Allen Browne wrote:

Thank you very much for the advice. I will give it a try in the morning
after I've managed to snag some Z's for a bit.

One thing that I did find out while poking & prodding at the database is
that if I remove some events that are handled via macros then the form works
properly and the reguery action in the macro also works properly. The funny
thing is, the macro that I ended up disabling as an event handler simply
sets a control value to "" and then gives that control focus. For some
reason, if I disable that particular macro the whole thing works properly.


Regards,

Chuck
--
Chuck Chopp

ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com
ICQ # 22321532
RTFM Consulting Services Inc. 864 801 2795 voice & voicemail
103 Autumn Hill Road 864 801 2774 fax
Greer, SC 29651 800 774 0718 pager
8007740718 (at) skytel (dot) com

Do not send me unsolicited commercial email.
 
G

Gary Miller

Thanks, totally aware that it should be avoided and have
studied and experienced many of the issues. Just wondered if
you had any skinny on why it hasn't been straightened out.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Allen Browne said:
Some of the issues have been addressed. It's just that it's such a bad
feature with so many different issues that you are better to avoid it
completely.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Allen,

Just for my curiousity, with all of the issues on this, are
you aware why this hasn't been addressed and corrected in
the Service Packs?
--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Hi Chuck.

The pipe character in error message 2465 is a place
holder
for the field
name. Clearly Access is unable to identify what field
is
is talking about.
The most likely cause is a fault in how Access is
tracking
its "Name
AutoCorrect" feature. See if this solves the problem:
1. Compact your database (Tools | Database Utilities | Compact).

2. Create a new (blank) database.

3. In the new database, uncheck the Name Correct boxes under:
Tools | Options | General.

4. Import all objects from your problem database
except
for the linked
tables:
File | Get External | Import.

5. Attach the linked tables from your back end file:
File | Get External | Link.

Hopefully that will get you going.


More info on Name AutoCorrect:
The feature does not work properly with:
- queries (230723, 247488, 256101, 282322),
- forms (230741, 275063),
- reports (231634, 240826).
It does not work at all with macros, modules, and DAPs.
It fails with converted databases (230616), and
imported
objects (231676).
It messes up design-time licences (824165).
It is a serious performance problem (200600, 290181).
It causes Access to crash (322794, 319491), therefore corrupting databases.

To view the articles referred to above, use:
http://support.microsoft.com/?id=KBnumberhere


--
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.

I have a form in an Access 2000 database application that calls a macro
when
the On Activate event occurs. This macro simply performs the Requery
action
and does not specify any object/control name in the parameter which should
result in the data source for the form [a query]
being
refreshed.
Previously, this worked w/o any problems at all. Recently, some changes
were made to record definitions [added some new
fields]
in some of the
tables [these are linked tables in a .MDB file that
is
separate from the
one
that the forms, macros & modules exist in], but no changes were made that
should have affected the query. I didn't rename any existing fields.

Anyway, whenever the macro is executed, a message
box is
displayed as
follows:

Title = "Action failed"

The macro name, a condition value of "True", an
action
name of "Requery"
and
an empty string for "Arguments" are all displayed in
the
message box.
The only button that isn't disabled is "Halt".

When I click on the "Halt" button, the macro is
halted
and then the form
displays itself and it appears that all of the
records
[this is a master
record form] are displayed on the form. If I give
focus
to a different
form
and then return to this form again, the On Activate event occurs again and
the same message box is displayed again.

Next, I replaced the macro that uses the Requery
action
with a VB event
procedure that calls the Requery method for the
form. I
simply use
"Me.Requery" in the event procedure. I am still
getting
an error when the
requery is performed, but the message is slightly
more
informative and
appears as follows:

Message box title = "Microsoft Visual Basic"
Message box text is as follows:

Run-time error '2465':
CDM Update Database can't find the field "|" referred to in your
expression.

The enabled buttons are "End", "Debug" and "Help".


I've reviewed the query object that the form uses as
a
data source [in
design view and in SQL view] and I cannot find any occurrences of a field
named "|" being used at all. I have also gone
through
and verified every
single field and control reference in the form
itself
and in the main form
that opens this master record form and, again, no
typos
were found.
I reviewed various postings found via Google but I didn't find anything in
particular to solve this problem.

Any ideas what might be going wrong?
 
Ad

Advertisements

A

Allen Browne

You may want to set the value to Null rather than a zero-length string.
 
C

Chuck Chopp

Allen said:
You may want to set the value to Null rather than a zero-length string.

Unfortunately that didn't fix the problem.

I'm going to experiment with replacing the macro with VBA code in a formal
event handler function. At least that gives me full control in the debugger
instead of just guessing about what is happening in the macro that is
causing this problem to occur.


--
Chuck Chopp

ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com
ICQ # 22321532
RTFM Consulting Services Inc. 864 801 2795 voice & voicemail
103 Autumn Hill Road 864 801 2774 fax
Greer, SC 29651 800 774 0718 pager
8007740718 (at) skytel (dot) com

Do not send me unsolicited commercial email.
 
C

Chuck Chopp

Here's some updated information about this problem.

I have the requery being performed via the Requery method in an event
handler function for the "On Activate" event. I have traced the source of
the problem to another event handler. Currently, the form has "On Got
Focus" and "On Load" events being handled by a macro that sets a field value
to an empty string and then gives focus to that control. If I remove the
macro step that sets focus to that control then no errors are generated when
the Requery is performed. I replaced the macro with an event handler
function and when the "SetFocus()" method is called for that control in the
event handler, then the error starts occurring again when the Requery method
is called.

The control that is receiving focus is a text box control which is unbound.
This control has an "After Update" event handler that causes its value to
be used in a filter that gets applied to data from the query that the
current form uses as its datasource. As long as the On Load and On Got
Focus events for the form set focus to this text box then the Requery method
results in a run-time error 2465 being generated.

What I don't understand is why this sequence of events & actions causes this
problem to occur.

Does anybody have any idea why this happens?


TIA,

Chuck
--
Chuck Chopp

ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com
ICQ # 22321532
RTFM Consulting Services Inc. 864 801 2795 voice & voicemail
103 Autumn Hill Road 864 801 2774 fax
Greer, SC 29651 800 774 0718 pager
8007740718 (at) skytel (dot) com

Do not send me unsolicited commercial email.
 
B

Billy Yao [MSFT]

Hi Chuck,

Thank you for using MSDN Newsgroup!

From your description, I understand that you receive the 2465 error '¡­.can't find the field "|"¡­. '
when you performed a requery in the result of On Activate event. Have I fully understood you?
If there is anything I misunderstood, please feel free to let me know.

First of all, I'd like to thank Allen for his efforts on your issue. I think he has pointed out a lot of
the possible causes of your problem and provide detailed information.

Looking through the whole thread, I'm also not sure why this sequence of events & actions
causes that run-time error. Based on my experience, however, it may be a Timing issue with
Form events. In other words, a Field Variable which one Access process is expected to be
populated is not yet populated by another process. This may not be reproduced on slower
machines, where Access has sufficient time to populate the Field Variable.

In this case, I recommend you take the following suggestions to see if they can workaround
the problem or suppress that error message:

a) Use SendKeys statement to perform the Refresh (F9)
b) Use the On Error Resume Next statement if no detrimental behavior exists
c) Adding an Error Handler to specifically handle the 2465 Error
d) Rewrite the application, putting all code in Standard modules, and calling the
Subs/Functions instead of relying on Form Events to occur for processes to run.

If all the above also don't make sense, I think you'd better contact Microsoft Product Support
Services (PSS) for direct assistance, with which the intensive troubleshooting would be done
quickly and effectively with PSS. You may contact PSS via:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS


Best regards,

Billy Yao
Microsoft Online Support
 
C

Chuck Chopp

Billy said:
Hi Chuck,

Thank you for using MSDN Newsgroup!

From your description, I understand that you receive the 2465 error '¡­.can't find the field "|"¡­. '
when you performed a requery in the result of On Activate event. Have I fully understood you?
If there is anything I misunderstood, please feel free to let me know.

First of all, I'd like to thank Allen for his efforts on your issue. I think he has pointed out a lot of
the possible causes of your problem and provide detailed information.

Looking through the whole thread, I'm also not sure why this sequence of events & actions
causes that run-time error. Based on my experience, however, it may be a Timing issue with
Form events. In other words, a Field Variable which one Access process is expected to be
populated is not yet populated by another process. This may not be reproduced on slower
machines, where Access has sufficient time to populate the Field Variable.

In this case, I recommend you take the following suggestions to see if they can workaround
the problem or suppress that error message:

a) Use SendKeys statement to perform the Refresh (F9)
b) Use the On Error Resume Next statement if no detrimental behavior exists
c) Adding an Error Handler to specifically handle the 2465 Error
d) Rewrite the application, putting all code in Standard modules, and calling the
Subs/Functions instead of relying on Form Events to occur for processes to run.

I have moved all of the event handling code into standard modules to
eliminate all of the macros. However, the problem persists. As best as I
can tell, your assessment that it may be some sort of timing issue may be
the best guess at what is wrong. The original environment in which this
application was running is on a Citrix server that is moderately busy and
which has to share time slices of the CPU with a larger # of concurrently
running application. However, this problem was encountered when I moved the
database to a local hard drive on my laptop to do some more intensive
development work with it. My laptop is a 2.4 GHz Mobile P4 with 2GB of RAM
running WinXP Pro SP1a. When the app runs on my laptop, it is the only
active application on the system so the timing related dynamics are very
different from what they are on the Citrix server. If I assign focus to the
unbound text box after the requery by making it all sequential code in the
On Activate event handler subroutine, then the problem goes away. Some how
the unbound text control interferes with a requery. Anyway, I have an
adequate work-around for the problem so I'm happily on my way to working on
other parts of the application.


Regards,

Chuck
--
Chuck Chopp

ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com
ICQ # 22321532
RTFM Consulting Services Inc. 864 801 2795 voice & voicemail
103 Autumn Hill Road 864 801 2774 fax
Greer, SC 29651 800 774 0718 pager
8007740718 (at) skytel (dot) com

Do not send me unsolicited commercial email.
 
Ad

Advertisements

Joined
Jan 26, 2020
Messages
1
Reaction score
0
CurrentDb.Execute "INSERT INTO tbl_Login (Fullname , Username, Password, Gender, Email_ID, Mobile/Pnone No , RegisterDate) VALUES ('" & Me!Fullname & "','" & Me!Gender & "','" & Me!Username & "','" & Me!Password & "','" & Me!Email_ID & "','" & Me!Mobile___Phone__No & "','" & Me!RegisterDate & "')"
MsgBox "Register Successfull Now you can Login wtih your (Username and Password)"

'Now after that we will open our login form okay

DoCmd.BrowseTo acBrowseToForm, "Login Page", , , , acFormAdd ' this code will show us our login form back okay.

End If
End If
End If
End If



End Sub

getting run-time error 2465 need solution changed replaced with Email didn't work searced many forums couldn't get any solution
 

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

Top