Need MS Access 2010 64bit VBA help

kwheil
kwheil used Ask the Experts™
on
I have been using a routine from MS Access Inside Out 2003 (also on the Microsoft Website) to insert image paths into a field. I recently converted to MS Access 2010 64bit due to a need for compatibility with AutoCAD Revit 64bit. While the code compiles and the application seems to work, it will not open the file dialog to select a file to insert. The problem occurs in the comdlg module in the following section:

    ' Display the appropriate dialog.
    If bOpen Then
      Show = GetOpenFileName(OFN)    <--This does not work
    Else
      Show = GetSaveFileName(OFN)
    End If

The attached zip file includes a sample database along with sample images that should be located in a folder labeled "pictures" which is the default location.

I need to know how to open the file dialog box in 64bit VBA. The database will only compile in 64bit due to the declare statement including a PtrSafe function. If this is removed it will run fine in 32bit including the insert photo function.

Thanks for any assistance.

Wayne
PhotoDB.zip
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems Analyst
Top Expert 2007

Commented:
This isn't the answer (sorry), but even the Microsoft Access product group people told us *not* to use Office x64 unless "we needed to work with some really super mega size Excel spreadsheets".

This PtrSafe came up in a Q 3-4 days ago.  I only have Win7 x64 O2010 x32.

Is GetOpenFileName  the Ken Getz wrapper or the actual API call ... I can't remember ...?

mx
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems Analyst
Top Expert 2007

Commented:
FWIW ... here is the Ken Getz version, which I recently tested in Win7 x64 O2010 x32 and it works.  Sorry, don't have access to Office x64

mx
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems Analyst
Top Expert 2007

Commented:
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Author

Commented:
Your reference looks promising. Thanks for the tip. I will try tomorrow morning and let you know if it works. Its definitely the relavent code.
Database Architect / Systems Analyst
Top Expert 2007
Commented:
Welllll ... it's actually one I've already read just recently PtrSafe  ... and he shows a modified version of Getz's code which he says is required to work on Win 7 x64 (but O2010).  Says this issue is '64 bit Win', not Access.

But as we speak, over on my A2010 Win 7 x64 system ... I'm browsing to files with the original Getz code with no problem, so ... I really don't know what he is talking about.

mx

Author

Commented:
The code changes noted in Grover Park George's blog worked perfectly. Problem solved. I wish I could award you more points since this solution was extremely helpful.

Thanks so much.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems Analyst
Top Expert 2007

Commented:
I exchanged some emails last night with George.  He as unsure about 32 bit in fact, meaning he had forgotten that his post was related to 32 bit Office/vba.  BUT ... apparently then, it is the fix for 64 bit Access!  So, that is good news and I will l let him know.

Glad we got this worked out!

mx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial