Go Back   Access World Forums > Apps and Windows > Visual Basic

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-19-2017, 01:38 AM   #1
alabad
Newly Registered User
 
Join Date: Jul 2012
Location: Kuwait
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
alabad is on a distinguished road
Access 2016 VBA

VBA issue: how to change reference from 32bit to 64 bit in access 2016 VBA? my Access file is 2016 32bit component of office 2016 32 bit, in Win 10 64 bit, then i removed office 32bit and installed office 64 bit this done by Microsoft technician staff, then when tried to open my access database file 32bit, i had a a VBA pop up message asking me to update the code in VBA from 32bit to 64bit. I attached 2 photo to help clarify my issue.
thanks
alabad
Attached Images
File Type: jpg access_32bit.JPG (67.9 KB, 84 views)
File Type: jpg access2_32bit.JPG (71.4 KB, 61 views)


Last edited by alabad; 01-19-2017 at 01:43 AM.
alabad is offline   Reply With Quote
Old 01-19-2017, 04:42 AM   #2
sneuberg
AWF VIP
 
Join Date: Oct 2014
Location: Tucson, Arizona
Posts: 3,493
Thanks: 359
Thanked 959 Times in 929 Posts
sneuberg will become famous soon enough sneuberg will become famous soon enough
Re: Access 2016 VBA

I'd reconsider the choice of 64 bit Office. This half explains what needs to be done to make the declare statements compatible. I say half because you also need to know the details of the API your are dealing with.

Unless you can't live without a 64 bit feature (e.g. big Excel Spreadsheets) I suggest installing the 32 bit version of Office. I think this thread demonstrates that getting these declarations right can be difficult and it appears that the AWF forum members have little experise in the area.
__________________
And now nothing will be restrained from them, which they have imagined to do. Genesis 11:6

Steve

Last edited by sneuberg; 01-19-2017 at 04:47 AM.
sneuberg is offline   Reply With Quote
Old 01-19-2017, 05:19 AM   #3
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,463
Thanks: 40
Thanked 3,380 Times in 3,275 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Access 2016 VBA

I agree with Sneuberg. Better to stick with 32bit office unless you need the additional processing power for Excel - i.e. spreadsheets with 500k+ rows.

the easy bit is to adding ptrsafe to the function declaration. The harder bit is knowing when to change longs to longlongs.

Simply you could just replace longs with longptr which will convert as required depending on the version of access, but it is better to only apply when required. You will also need to convert any dimmed variables where required as well. i.e. assigning an api function value which is long or longlong

This is quite a useful link and has further links to other resources

http://www.jkp-ads.com/articles/apideclarations.asp

Note that if you create a .accde then even with the changes made, a .accde created in 64bit access will only work on another 64bit office installation. Similarly a 32bit .accde will not run on a 64bit office application. And you cannot have both 32 and 64bit office on the same machine (not even if one of them is runtime).

__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 01-19-2017, 07:43 AM   #4
static
Newly Registered User
 
Join Date: Nov 2015
Posts: 823
Thanks: 4
Thanked 192 Times in 179 Posts
static will become famous soon enough static will become famous soon enough
Re: Access 2016 VBA

You can replace those functions with environ.

Code:
Debug.Print Environ("username")
Debug.Print Environ("computername")
static is offline   Reply With Quote
Old 01-19-2017, 08:21 AM   #5
sneuberg
AWF VIP
 
Join Date: Oct 2014
Location: Tucson, Arizona
Posts: 3,493
Thanks: 359
Thanked 959 Times in 929 Posts
sneuberg will become famous soon enough sneuberg will become famous soon enough
Re: Access 2016 VBA

Quote:
Originally Posted by static View Post
You can replace those functions with environ.

Code:
Debug.Print Environ("username")
Debug.Print Environ("computername")
This web page seems to say that these are not safe especially with operating systems prior to Windows 7.
__________________
And now nothing will be restrained from them, which they have imagined to do. Genesis 11:6

Steve
sneuberg is offline   Reply With Quote
Old 01-19-2017, 08:36 AM   #6
static
Newly Registered User
 
Join Date: Nov 2015
Posts: 823
Thanks: 4
Thanked 192 Times in 179 Posts
static will become famous soon enough static will become famous soon enough
Re: Access 2016 VBA

That web page seems to be related to linux.

Whatever, I've never heard anybody have trouble with it.

static is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2016 namliam General 3 08-08-2016 01:54 AM
Deploying Access 2016 Front End, Access 2016 RossWaddell General 2 07-24-2016 05:43 AM
Access 2016 runtime and older full versions of Access Ktrez1 General 0 01-03-2016 05:28 PM
Access 2016 sgladie@bgsu.edu General 1 10-14-2015 01:19 AM
What's new in Access 2016 pbaldy General 3 09-22-2015 03:36 PM




All times are GMT -8. The time now is 03:55 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World