I need a solution similar to the Microsoft Customize Quick Access Toolbar dialog

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #31
    To clarify, it's not the WINDOWS OS version that should be the issue it is the OFFICE/Access installation.

    In fact, I run OFFICE2013(32bit) installations on my home pc under Windows8.1(64Bi t) and at work under Windows7Enterpr ise(64Bit) without any issues.

    The ONLY time I've ever encountered the ""The code in this project must be updated for use on 64-bit systems. (...)"" error message was on a OFFICE 64bit install which we promptly un-installed and re-installed 32bit OFFICE version because the user didn't need the additional features of the 64bit version as described in the link provide in my last post. The reason my friend installed the 64bit OFFICE version was because he thought that because the OS was 64Bit then the Office install should be too, frankly, that was my first thought too until I started researching the issue for him.

    Frankly, I would simply alter the api call for the PC name to use the ptrSafe - hasn't caused any issues on my 32bit installations; however, you can use the contional #IF... #END IF construct as shown in the link just to be sure there are no issues.

    Code:
    Private Declare [iCODE]PtrSafe[/iCODE] Function apiGetComputerName Lib "kernel32" Alias _
         "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    Last edited by zmbd; Jun 11 '16, 05:52 PM.

    Comment

    • PhilOfWalton
      Recognized Expert Top Contributor
      • Mar 2016
      • 1430

      #32
      I presume you are aware of Compiler Directives such as

      Code:
          #If VBA7 Then
            Private Declare PtrSafe Function WinAPISetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As LongPtr) As Long
          #Else
            Private Declare Function WinAPISetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
          #End If
      This uses the correct API depending on the Access verssion being used.

      There are similar Compiler directives depending on which version of windows is used.
      I guess that currently, most users are on Windows 7 or 10 which, is available in both 32 & 64 bit, but providing you have a reasonably up-to-date machine will probably be running 64 bit.

      I may be wrong, interested to hear other expert's views, but I seem to get away with either version of an API call without using the compiler directive and everything seems to work

      Phil

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #33
        I've used the PtrSafe in the Windows-OS 64-Bit with OFFICE-32bit without issues; HOWEVER, I have heard/read about issues with using the the PtrSafe in Windows-OS 32-Bit installs - hence why I suspect the that that the compiler directives are covered in the link provided in Post#29 to the 32/64-bit compatibility and once again alluded to in Post#31

        ( ...more... ) This data type and the new PtrSafe attribute enable you to use this Declare statement on either 32-bit or 64-bit systems. The PtrSafe attribute indicates to the VBA compiler that the Declare statement is targeted for the 64-bit version of Office 2010. Without this attribute, using the Declare statement in a 64-bit system will result in a compile-time error. Note that the PtrSafe attribute is optional on the 32-bit version of Office 2010. This enables existing Declare statements to work as they always have. (...)
        Last edited by zmbd; Jun 12 '16, 01:33 PM.

        Comment

        • Hinson3
          New Member
          • May 2016
          • 18

          #34
          As far as getting the computername: I tried the following code:
          Code:
          If VBA7 Then
              Public Declare PtrSafe Function GetComputerName Lib "kernel32" _
                  Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
          Else
              Public Declare Function GetComputerName Lib "kernel32" _
                  Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
          End If
          It did not work, so I’m going to put it on the back burner for now as I need to get the 2 listboxes to work. Most of our users are on Office 2010 anyway, unfortunately, my office suite was upgraded to 2013 but I still have an Office 2010 desktop, which is what I will use going forward. I appreciate you responding even though it’s a topic for another forum. I’m learning the rules.

          2 ListBox
          Phil, First, I’m trying to understand exactly how the “2 List box” will work within the WrapUp form so that I can create a relationship. I’m trying to insert the two listboxes into the WrapUp form; it has all the data related to the current record. i.e. (Date, time, queue#, services, names etc). So, I’m trying to relate the WrapUp form with EmpPCandService or tbl_productServ ice table. Since the EMPCandService table only has a foreign key, I cannot do a one to many and I expect to have 1 member or guest (record) to many services. Which is the sole purpose for the 2ListBoxes form.

          Secondly, Right now, both the EmpPCandService table and tbl_ProductServ ice displays all 95 services. When I open the TwoListBox form and make a selection – it does Check the selection(s). Am I to create a filter to show only checked services?

          Original thought. . .
          Was to have a WrapUp form that provided a summary of everything about the current record. It also allows the employee to modify and/or populate any required fields. Then, use the 2ListBoxes to add all the services they provided in one window. Before, they were in a continuous form and had to click an Add Record button that copied the current record Account#, Name and allowed them to add the additional service. They had to click that button for each service. I’m trying to work smarter.

          Thank you again for you help.

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #35
            You Have To Use The Hash-Tag-IF #IF Construct

            Please read the link I provided, it covers this in great detail.
            Last edited by zmbd; Jun 16 '16, 12:07 AM. Reason: [z{I hate pc updates... messed up the formatting}]

            Comment

            • Hinson3
              New Member
              • May 2016
              • 18

              #36
              Thanks ZMBD, I did try the #F and still got an error. I will try again tomorrow and report the message I get.

              Thanks again.

              Comment

              • zmbd
                Recognized Expert Moderator Expert
                • Mar 2012
                • 5501

                #37
                " #F " typo? We can fix that :)

                Where in the module did you place the #IF construct?
                It must be the first thing after the Option statements and it does not go in a procedure.

                If you post that part of your code we can take a look, given that we're trying to solve the primary question this is still marginally on topic :)

                Comment

                Working...