Compile Error

hmrichfield

New member
Local time
Yesterday, 18:51
Joined
Jun 26, 2013
Messages
4
Hi there,

I am working on a MS DB which was originally created in a 32 bit version of MS access. Since then, IT updated half the users with 64-bit versions of MS Office. It is non-optional to use a mix of both versions of MS.

The individuals operating on the 64-bit version received an error every time they opened the DB. I have included pictures below of the error (Note: First picture which shows the code line: Lib "shell64.dll" is not what is actually in the program. The code reads: Lib "shell32.dll". I was just messing with it to see if that would be a quick fix.) both before and after I was able to get the system to fix.



Now, I have a new error (below) when trying to execute the command to run the report. It appears that one of the Macros is not executing properly and I'm unsure as to if it's something related to the code fix I implemented today, or if this could be an entirely separate issue. Any insight is appreciated!

Thanks :)
 

Attachments

  • Code - Error.png
    Code - Error.png
    11.9 KB · Views: 92
  • Code - Fixed.png
    Code - Fixed.png
    14.8 KB · Views: 107
  • Ops Error Pt 1.jpg
    Ops Error Pt 1.jpg
    14 KB · Views: 82
  • Ops Error Format 2.jpg
    Ops Error Format 2.jpg
    31.2 KB · Views: 106
Provide some Access version numbers (e.g. Access 2010) for both versions.

Did you just open the old access version with a new version of access to let it automatically update?

There are some examples on this site of what to do.
Take your original 32 bit version (not one that has been opened by the newer 64 bit version using file open).

Open a new blank 64 bit version.
Import in all objects (tables, code, queries, macros, reports, ...)
Reset up the start form and such.

Depending on the versions, there are probably some language differences.
Look into this and give us some feedback.
 
If I am reading this correctly you have two versions 32 and 64 bits installed.. Is that right, either have #If#Else directives or declare all functions that uses library function to PtrSafe.. In my opinion declaring with #If#Else directive is the best way to go.. Something along the lines of..
Code:
[COLOR=Green]'Windows API Function Declarations[/COLOR]
#If Win64 = 1 And VBA7 = 1 Then
    
   [COLOR=Green] 'Does the clipboard contain a bitmap/metafile?[/COLOR]
    Private Declare PtrSafe Function IsClipboardFormatAvailable Lib "user32" (ByVal wFormat As Integer) As Long

#Else

    [COLOR=Green]'Does the clipboard contain a bitmap/metafile?[/COLOR]
    Private Declare Function IsClipboardFormatAvailable Lib "user32" (ByVal wFormat As Integer) As Long
#End If
 
Do you miss some References?
Open the "Code window" - Chose from the menu line, "Tools"->"References" open the References window, look for the word "Missing". If found, uncheck it, close the window, and open it again, find the references you unchecked and check it again.
 
@ RX: Apologies. The version is 2010 for both 32 & 64 bit. I cannot get Access to open and update as it errors out before the DB even kicks off.

@ pr2-eugin: There are both versions installed on varying PC's. The issue is that I don't know who is using what version at what time. Theoretically, the same user could switch computers at some point and move from using 32-bit MS Office to 64-bit. I need the program to stabalize in both versions. Where is your suggestion to place the code? In the ShellExecute Code window that I've shown below?

@JBH: Good question. I'll take a look at get back to you. Is this something to do in both the 32-bit and 64-bit versions? Or just do it in the main DB and it should apply when opening regardless of the PC the user is on?
 
Last edited:
@JBH there is no option to select 'Missing' so there goes that option.. Thanks for the suggestion.
 
As I have mentioned, If the same code is used in both varying environments you need to use #If #Else directive.. From my work experience I know, as i work with the same 32 bit and 64 bit versions.. The problem is all functions that uses a Dynamic Library needs to be declared as PtrSafe..

What do you mean by,
@ pr2-eugin: There are both versions installed on varying PC's. The issue is that I don't know who is using what version at what time. Theoretically, the same user could switch computers at some point and move from using 32-bit MS Office to 64-bit. I need the program to stabalize in both versions. Where is your suggestion to place the code? In the ShellExecute Code window that I've shown below?
you have to adapt them to your code, I just gave you am example of how it should be like..
 
Thanks to all of you for the info - I had the coding fixed properly. The new error was an issue with the printer output which is what I wasn't sure of. Thanks again to all that replied! :)
 
@JBH there is no option to select 'Missing' so there goes that option.. Thanks for the suggestion.
Only for clarifying, (then you have solved your problem) - "Missing" is not an option, it is the word standing before reference name, see below.
attachment.php
 

Attachments

  • Missing.jpg
    Missing.jpg
    58.5 KB · Views: 282

Users who are viewing this thread

Back
Top Bottom