Results 1 to 9 of 9
  1. #1
    docweaver is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    5

    compile error

    Use received new PCs. Have a simple front end and backend database that I have inherited. Thought it was a simple copy FE to new system and relink to BE on server. However, when I open the form I get compile errors. Not sure how they set it up.



    paulClick image for larger version. 

Name:	IMG_1830.JPG.jpg 
Views:	19 
Size:	164.1 KB 
ID:	29412Click image for larger version. 

Name:	IMG_1831.JPG.jpg 
Views:	19 
Size:	231.0 KB 
ID:	29413

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    I have never used variables with $ in their name. Could change all the error handling MsgBox calls to something like:

    MsgBox "Error encountered in form Main Menu procedure ETB_Click - " & Err & " : " & Err.Description

    Review http://allenbrowne.com/ser-23a.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  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,922
    From the code window go to Tools>References... and see if you have any marked as MISSING. They could be bogus. Remember the reference and uncheck it and see if the project will compile.

  4. #4
    docweaver is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    5
    Thanks I'll try. What is strange is that it has been work with no issue for years and still works on all of the old machines.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    the $ is the old way of saying it is a string. I see you are 2016. VBA has maintained backwards compatibility for many years, but may well have now been deprecated in 2016. MS do seem to being doing a big tidy up and removing support for very old systems. You now have err.number and err.description

    see this link https://bytes.com/topic/access/answe...oes-error-mean

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Error$ dates back to Access 2.0
    My guess would be that the new machines don't have the old reference file(s) (i.e. the .dll, .olb or .tlb) and the later versions of the necessary files (such as whichever contains the vba error handler) aren't backwards compatible.

    A Find/Replace could take care of the outdated code, but I'd do this on a backup of the db, just in case.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Seem to recall it actually goes back to the original Basic language circa 1970's

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    incidentally, Windows 10 has a snipping tool to take screenshots of all or part of your desktop. Much better than using a camera.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	16 
Size:	14.3 KB 
ID:	29421

  9. #9
    docweaver is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    5
    The uncheck the DAO reference and Utility.mda seemed to have worked for now. Thanks

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

Similar Threads

  1. Replies: 7
    Last Post: 07-24-2013, 02:01 PM
  2. Compile Error: Syntax Error in DoCmd.RunSQL Statement
    By Evilferret in forum Programming
    Replies: 1
    Last Post: 08-27-2012, 12:32 PM
  3. Replies: 2
    Last Post: 06-23-2012, 11:59 PM
  4. Replies: 7
    Last Post: 06-08-2012, 09:55 PM
  5. Replies: 6
    Last Post: 09-28-2011, 09:20 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