Results 1 to 7 of 7
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    programming for 32 and 64 bit

    I've got to adjust code in an existing project to work for both 32bit AND 64bit systems; so, I'll need to check which is being run, and then write an If/Then clause. to add or not add the Print Safe stuff

    2 Q's

    Do I have to progam this in VBA7 ?
    Currently, I have VB for applications 7.1 .1024 running on Windows 7 x64 and <my> version of Access is 32bit

    yet when I run the snippet:

    If VBA7 Then
    MsgBox "VBA7"
    Else


    MsgBox " not 7"
    End If

    the return is " not 7"


    next Q
    what wouldbe the code to check for 32bit vs. 64bit; and are there any pitfalls and traps that i ought to be aware of?



    with many thanks in advance,
    mark.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    VBA7 is just a way to determine if Access is 64 bit or 32 bit. It is nothing more or less than that.

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    when I ran the same code on a machine that is running Access 64bit;
    the response is still " not 7" ??

    I must be missing something that in time will be "obvious"

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If you go to help or options and "About Access", it says that version is 64bit?

  5. #5
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    Yup it's 64bit

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Hmmm, I thought it was VBA7 that was 64 and apparently it is not. The VBA7 constant checks for version and it seems you need to use the # sign to get it to work. The following is the best explanation on what code works for what versions.
    https://msdn.microsoft.com/en-us/library/ee691831.aspx

    Code:
    #If Win64 Then
       MsgBox "Win64 yes"
    #Else
       MsgBox "Win64 no"
    #End If
    #If VBA7 Then
       MsgBox "VBA7 yes"
    #Else
       MsgBox "VBA7 no"
    #End If

  7. #7
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    that was it...
    thnx !

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

Similar Threads

  1. Replies: 4
    Last Post: 05-29-2015, 09:36 AM
  2. VBA Programming
    By Leeselson in forum Programming
    Replies: 4
    Last Post: 06-06-2012, 05:08 PM
  3. Monthly Programming
    By ekaragew in forum Programming
    Replies: 1
    Last Post: 06-21-2011, 05:37 PM
  4. Programming
    By JLT in forum Programming
    Replies: 10
    Last Post: 04-14-2011, 10:07 AM
  5. VB Programming
    By mstefansen in forum Programming
    Replies: 4
    Last Post: 08-31-2009, 07:15 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