Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open Calculator (Access 2000)

    I would like to know how I could open the basic calculator application in windows by pressing a button is an Access from. The user can be on Win 98 OR Win XP, so would that make a difference in the path the program is in? For now though, I just need it to work in Win 98

    Thanks

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Open Calculator (Access 2000)

    I just created a command button on a form (under Access 97 and Win 98) using the wizard, and this is the code generated:

    <pre>Private Sub cmdCalc_Click()
    On Error GoTo Err_cmdCalc_Click

    Dim stAppName As String

    stAppName = "calc"
    Call Shell(stAppName, 1)

    Exit_cmdCalc_Click:
    Exit Sub

    Err_cmdCalc_Click:
    MsgBox Err.Description
    Resume Exit_cmdCalc_Click

    End Sub
    </pre>


    Because the calculator is in the windows path variable, I don't need to specify the full path for it. By not putting in the path, it would work if the calculator was in a different location (but still in the Windows path varialbe.)
    Regards
    John



  3. #3
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open Calculator (Access 2000)

    Awesome, works like a charm [img]/forums/images/smilies/smile.gif[/img]

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •