Results 1 to 5 of 5
  1. #1
    vinaximus is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Location
    Jaipur, India
    Posts
    2

    Running VBA code as 32bit in acces 2013 x64

    Hi everyone



    I have an activex that only works in 32bit. It works perfectly with 32bit Access and Visual basic code compiled as 32bit. However it fails on 64bit access. Is there a way I can run x64 access code as 32bit or x86?
    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I have never used ActiveX controls. I do have 32bit API functions. Had to use PtrSafe qualifier, such as:

    Private Declare PtrSafe Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal wRevert As Long) As Long
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    Is there a way I can run x64 access code as 32bit or x86?
    see this link https://msdn.microsoft.com/en-us/library/gg264421.aspx which explains the differences and what changes you would need to make to your code to work in either environment - the answer is a definite no for compiled code. With regards ActiveX controls, you need to use a 64bit version of the control with 64bit access and 32bit version with 32bit Access.

  4. #4
    vinaximus is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Location
    Jaipur, India
    Posts
    2
    Thanks, I am not a pro but this is my scenario. Please spare time to understand it

    I am using a brothersoft dll "bpac.dll" as an external reference in access 2013

    Following is the code to print from the printer

    Private Sub btnPrint_Click()
    Dim ObjDoc As bpac.Document 'bpac.document
    Set ObjDoc = CreateObject("bpac.Document")
    Dim strFilePath As String
    'Code to assign label text lies here

    ObjDoc.GetObject("objCompany").Text = Me.txtPost.Value
    ObjDoc.GetObject("objName").Text = Me.txtName.Value
    ' ObjDoc.SetMediaById ObjDoc.Printer.GetMediaId(), True
    ObjDoc.StartPrint "", bpoDefault
    ObjDoc.PrintOut 1, bpoDefault
    ObjDoc.EndPrint
    ObjDoc.Close
    Set ObjDoc = Nothing

    End Sub

    This code works fine with the 32bit but fails at 64bit( printer does not print and nothing happens). Is there a way to run this code or use declare statement? If so please how

  5. #5
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    sorry, no idea. QAs previously advised, you'll need to contact brother/brothersoft for a 64bit version of bpac.dll

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

Similar Threads

  1. Replies: 6
    Last Post: 06-05-2015, 03:08 AM
  2. 32bit 64bit / vba vba7 (which am I running?)
    By markjkubicki in forum Programming
    Replies: 1
    Last Post: 04-08-2014, 10:50 PM
  3. Problem with new computer running Word 2013
    By rankhornjp in forum Programming
    Replies: 15
    Last Post: 03-06-2014, 11:17 AM
  4. Access 2013 running very slow
    By razors1968 in forum Access
    Replies: 0
    Last Post: 08-01-2013, 01:31 PM
  5. acces listbox hatası(acces debug)
    By carso in forum Access
    Replies: 1
    Last Post: 09-22-2009, 04:11 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