Results 1 to 10 of 10
  1. #1
    Henriette50 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    10

    VBA trouble with old database

    Hi all,



    a long time ago I programmed an Access database with Office 2007.
    Until today everything is fine. I have Windows 10 installed, and there are no problems.
    Now I have to transfer to a new computer (Acer Laptop) where I was able to install Office 2007 again.

    Only: my Access Database is causing trouble.

    As soon as I run it and it has to make use of my VBA scripts it opens the programming window and I get the message: "Error at compiling. Sub or Function not defined" and it shows me my code.

    It seems VBA does not work properly.

    In the Visual Basic window, when I try to compile the database again, I get the message "Project or library not found". My references do point to the same 4 ocx files I used on my old computer. I successfully registered them (having copied them into windows/syswow) in the DOS box.

    Sorry for my english. I translated the messages and everything as best as I could.
    Could anybody help?

    Henriette, Germany

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,144
    Can you compare the references from your old machine to the new?
    I suspect you are still missing something.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    If you do PC updates it can mess up the referencs.
    if the OS is 64bit and Access is 64, you need to register them in c:\windows\system32
    (yes that's counterintuitive)

    also add PTRSAFE to all API calls.

  4. #4
    Henriette50 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    10
    Quote Originally Posted by Minty View Post
    Can you compare the references from your old machine to the new?
    I suspect you are still missing something.
    They are the same

    Click image for larger version. 

Name:	references.jpg 
Views:	18 
Size:	199.4 KB 
ID:	45805

  5. #5
    Henriette50 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    10
    Quote Originally Posted by ranman256 View Post
    If you do PC updates it can mess up the referencs.
    if the OS is 64bit and Access is 64, you need to register them in c:\windows\system32
    (yes that's counterintuitive)

    also add PTRSAFE to all API calls.
    Accidently, on my new laptop, my database was - suddenly - run by Microsofts' newest Access which is pre-installed for a month in order that I buy the new office apps (no bad idea, maybe).
    The error messages make sense to me now, after what you wrote. API calls were disliked, and there was something about 64 bit.

    If I would make these changes (add PTRSAFE and register the ocx files in System32), is there any chance such an old program would run with Microsoft latest Access? Actually it was programmed with Access 2000!

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,144
    You may well find that you need to convert your application to an ACCDE format to work.
    I believe you can do that from your 2007 version. It should then open in the later versions.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    Henriette50 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    10
    Quote Originally Posted by Minty View Post
    You may well find that you need to convert your application to an ACCDE format to work.
    I believe you can do that from your 2007 version. It should then open in the later versions.
    Thanks for your reply. How do I do this?

  8. #8
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,144
    In File Options - Save as I believe.
    I'm on O365 so can't remember the exact location for 2007 but that's where it is.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  9. #9
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    Do you need to be running Office 64-bit? You can still install the 32-bit version of MS Office on a Windows 64-bit system. I am not sure that, even after you re-register the ocx files, they will work in the 64-bit version as the common dialog has been removed from the 64-bit version (and I believe the calendar too).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  10. #10
    Henriette50 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    10
    Hi all.
    with your help I succeeded to get my database running! All day long I kept pondering what the reason for my database not running could be. As it was mentioned by most of you that it could be the references, I looked into that again. I then remembered I did have another reference to a small mda I once obtained which did not work anymore and which was not needed anymore and which I had deleted from the reference table. Well, Access never forgets! I had to put it in windows/system32, make it trustworthy and have the reference table point to it. And suddenly everything was fine!
    Thanks to all!

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

Similar Threads

  1. Trouble saving Database
    By chicks123 in forum Access
    Replies: 12
    Last Post: 03-04-2019, 04:40 PM
  2. My access database is in trouble
    By VerdianaZarro in forum Access
    Replies: 1
    Last Post: 01-26-2018, 12:05 PM
  3. Replies: 2
    Last Post: 11-27-2016, 11:12 PM
  4. Trouble with Book Database
    By funkymuppet in forum Forms
    Replies: 9
    Last Post: 04-01-2014, 06:30 PM
  5. Replies: 8
    Last Post: 09-20-2012, 10:23 AM

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