Link to home
Start Free TrialLog in
Avatar of kwheil
kwheilFlag for United States of America

asked on

Need MS Access 2010 64bit VBA help

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
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

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
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
Avatar of kwheil

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kwheil

ASKER

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.
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