Results 1 to 10 of 10
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Runtime Error 2465. What is it, and how do I fix it?

    In the attached db with several screenshots, I have a form, frmEmail, that allows me to select an employee from a combo box as shown in one of the screenshots.



    The employee name is selected and after that I get a runtime error of 2465. I am not sure what a runtime error 2465 is.

    The additional 2 screenshots, show the combo box that is in the code where it crashes and the output of runtime error 2465.

    It is here that things begin to fall apart.

    I built the procedure from what I found on the net. It worked, but then I found that I must add some code in the after update section of the combo box. I am not even sure what this code
    is there for. It must be added. The combo operation worked fine before the code was added, now it crashes with a runtime 2465 error.

    How do I fix this?

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No attachment Lou.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    A description for the error.
    2465

    2007
    Microsoft Office Access can't find the field '|' referred to in your expression.@You
    may have misspelled the field name, or the field may have been renamed or
    deleted.@@1@1@11730@1
    2003
    Microsoft Office Access can't find the field '|' referred to in your expression.@You
    may have misspelled the field name, or the field may have been renamed or
    deleted.@@1@411730@1

    2002

    Microsoft Access can't find the field '|' referred to in your expression.@You may

    have misspelled the field name, or the field may have been renamed or

    deleted.@@1@411730@1

  4. #4
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Here are the attachments that did not make it in my initial post.

    A zipped copy of my db is also included.

    Sorry about that. All I can say is that I should be more careful.

    Anyway the attachments are there and they should have been in the
    initial post.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    What is it you expect to happen? As the error says, there is no control named "Position" for it to set focus to.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Let consider what I expected to happened. Anything, but a runtime error crash. I got this code in the after working on parameter query and noticed that it was to be put in after update on the combo box event tab.
    Consider:

    [
    Code:
     DoCmd.ShowAllRecords
         Me!Position.SetFocus
         DoCmd.FindRecord Me!cboEmployeeName
    The middle line does have a position. So it got what it wanted?

    Is there something wrong with the line : Me!Position.SetFocus

    I am just am quite new to this. It seem that all that was needed is in the line in question.

    As I said in the initial post what is this after update code for?
    If I knew that it would probably help in understanding what is going on.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Well, if you want something other than a crash, use a control that exists. There's nothing wrong with the line itself; it's trying to set focus to a named control. That control has to exist though. It doesn't, so you get an error.

    I'm curious, if you don't know what it's for, why did you include it? The goal of it is to move the form to the selected record. "Position" would be the name of the control you wanted to use for the search. In your code, it would search that field for the name in the combo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I have learned to take some code that exists and works and modify it for my situation. It just seems the easy way. Now I saw this online and on YouTube. It works and it meets my needs, so I paid the most sincerest and highest complement I could; I stole it.

    However, I do not understand it crashing on that line.It must have been left out in the explanation. So I was baffled as to why it crashed.

    Please answer two thins. Why is this code there in the after update section (IE. what does it do)? Secondly how do I fix it it?

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I've answered both:

    The goal of it is to move the form to the selected record. "Position" would be the name of the control you wanted to use for the search. In your code, it would search that field for the name in the combo.

    That control has to exist though. It doesn't, so you get an error.

    I don't know how to say this any clearer. It errors because it refers to a control (textbox, etc) that doesn't exist on your form. The code can't set focus to someplace that doesn't exist.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm also confused by:

    Quote Originally Posted by Lou_Reed View Post
    It works and it meets my needs...what does it do?
    If you say it works and meets your needs, you must know what it does (or is supposed to do). If you don't know what it does, take it out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 01-15-2015, 01:10 AM
  2. runtime error 2465 'l1'
    By mike02 in forum Forms
    Replies: 5
    Last Post: 07-17-2013, 03:37 PM
  3. run time error 2465
    By karma in forum Access
    Replies: 3
    Last Post: 08-09-2012, 04:08 AM
  4. Run-Time error '2465'
    By hawkins in forum Access
    Replies: 6
    Last Post: 08-19-2011, 04:07 PM
  5. Not figuring out dlookup (RunTime 2465)
    By Gilligan in forum Access
    Replies: 10
    Last Post: 03-08-2011, 02:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums