Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    tkazi is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2024
    Posts
    14
    Well, yes, the code is use-less. I created it just to demonstrate the problem. The actual code does do some stuff to other forms when unloading. I do want to exit the form, hence cancel=true is not an option.

    Quote Originally Posted by isladogs View Post
    You have the following code in your Form_Unload event:

    Code:
    Private Sub Form_Unload(Cancel As Integer)   
     If [VersId] = 1 Then
        End If
    End Sub
    If you change the field name without updating the form design to match it, you will get error 2465: Microsoft Access can't find the field '|1' referred to in your expression
    This will of course prevent you closing the form unless you update the code to match the new field name

    However the code is pointless as written. Adding the line Cancel = True after Then will prevent the form closing without raising an error


  2. #17
    tkazi is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2024
    Posts
    14
    You did not get an error! Then could it be something wrong with my installation?

    Quote Originally Posted by June7 View Post
    Using Access 2010.

    Not getting error with posted db.

    Usually best to start a new thread and reference the old one if you think it would be helpful. New threads get more attention.

  3. #18
    tkazi is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2024
    Posts
    14
    I ran it on another computer and got the same error. Can you please retry. Just open for the form, foo2 and go to design mode, you should get an error.

    Quote Originally Posted by tkazi View Post
    You did not get an error! Then could it be something wrong with my installation?

  4. #19
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Works fine for me as well.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #20
    tkazi is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2024
    Posts
    14

    I think I found the problem, not verified yet

    Quote Originally Posted by Welshgasman View Post
    Works fine for me as well.
    My database uses Arabic text while Access does not natively handle Arabic. I can have it in the tables and data, but can't write Arabic in queries, or VBA. So I changed the "System Locale" on one of my computers to Arabic language. That enabled me to use Arabic in VBA and in queries, but then I started seeing some weird problems like this one and when I tried to convert from Access to SQL server, the conversion tool did not even recognize the tables in by DB. So I had to changed "System Locale" back to English, and recreate all the tables. So now the conversion tool worked. I am still having this runtime problem when I switch to design mode, but I believe, it will get fixed if I recreate the form and those tables. Have not tried yet because this is not show stopper for me. Thanks everyone for your time and input.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error 2467 When Trying to Reach Report Controls
    By 123noob in forum Programming
    Replies: 5
    Last Post: 03-21-2019, 05:34 AM
  2. Replies: 2
    Last Post: 03-13-2015, 09:11 AM
  3. Replies: 8
    Last Post: 04-29-2013, 11:23 AM
  4. Error 2467
    By Ray67 in forum Forms
    Replies: 1
    Last Post: 01-26-2013, 11:41 PM
  5. Runtime 2467 only on a Win 7 Machine
    By ilikebirds in forum Forms
    Replies: 3
    Last Post: 12-11-2012, 03:58 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