The Function PI()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Russell G
    New Member
    • Oct 2006
    • 7

    The Function PI()

    Hi

    I need to use the function PI() in a qAccess query....Proble m I can not find a function called PI. The function exists in EXCEL. I can use 22/7 or 3.14159...but it would be much easier to use the standard function.

    Am I missing it or not looking in the correct Help menu?
  • VALIS
    New Member
    • Oct 2006
    • 21

    #2
    Originally posted by Russell G
    Hi

    I need to use the function PI() in a qAccess query....Proble m I can not find a function called PI. The function exists in EXCEL. I can use 22/7 or 3.14159...but it would be much easier to use the standard function.

    Am I missing it or not looking in the correct Help menu?

    You might need to load an add-in msowcf.dll.
    Can you use ASIN() ?
    If this works then 2*ASIN(1) = Pi

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32636

      #3
      First (if it's really worth it to you), go to the VBA window (Alt-F11 from the Access window) and select 'References...' from the 'Tools' menu.
      From the list there, make sure 'Microsoft Excel 9.0 Object Library' (or the equivalent for your version of Office) is ticked.
      Now you can use the function Pi() as Excel.Worksheet Function.Pi().
      It's a lot of fuss for one function, but worth it if you're going to use other Excell worksheet functions.

      Comment

      • PEB
        Recognized Expert Top Contributor
        • Aug 2006
        • 1418

        #4
        Well done NeoPa!

        It's very usefull information...

        In fact I prefer to use the ordinary libraries that are installed on the computers... Coz in my installation should have the respective references...



        Originally posted by NeoPa
        First (if it's really worth it to you), go to the VBA window (Alt-F11 from the Access window) and select 'References...' from the 'Tools' menu.
        From the list there, make sure 'Microsoft Excel 9.0 Object Library' (or the equivalent for your version of Office) is ticked.
        Now you can use the function Pi() as Excel.Worksheet Function.Pi().
        It's a lot of fuss for one function, but worth it if you're going to use other Excell worksheet functions.

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by Russell G
          Hi

          I need to use the function PI() in a qAccess query....Proble m I can not find a function called PI. The function exists in EXCEL. I can use 22/7 or 3.14159...but it would be much easier to use the standard function.

          Am I missing it or not looking in the correct Help menu?
          The value of PI can be derived in the following fashion, either declaring it as
          a Global Constant or as such:

          Dim PI As Double
          Code:
          PI = 4 * Atn(1)

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32636

            #6
            Originally posted by PEB
            In fact I prefer to use the ordinary libraries that are installed on the computers... Coz in my installation should have the respective references...
            I wouldn't recomment that myself even PEB, but the library should be there available assuming Office (and not just Access) has been installed. It's just that the Refernce would have to be added to the database.

            I agree though, that using the native functions only, makes implementation much easier.

            Comment

            • Russell G
              New Member
              • Oct 2006
              • 7

              #7
              Hi,

              Thanks very much for the info RE PI()...I have decided just to use the value of 3.141592654 it was eaiser.

              Comment

              Working...