Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Calculator by Hitting the F12 Key

VBA and Custom Functions

Windows Calculator by Hitting the F12 Key

by  Bullschmidt  Posted    (Edited  )
To let the user hit the F12 key to bring up the Windows Calculator anytime you can do this:

o Create or add to a macro with the exact name of AutoKeys

o In the AutoKeys macro add this new row:
MacroName of {F12}
Action of RunCode with FunctionName of tlbCalculator()
Comment of Calculator

o Then create or add to any module the following function:

Public Function tlbCalculator()
' Purpose: Open Windows Calculator.
' Remarks: Called by AutoKeys macro.
' Calculator has View | Standard which is the orig. default
' or View | Scientific which I like best.
' Windows "remembers" the last setting for this.

On Error GoTo Err_tlbCalculator

' Open Windows Calculator (original size with focus).
Call Shell("CALC.EXE", 1)

Exit Function

Err_tlbCalculator:
Exit Function
End Function

J. Paul Schmidt, Freelance Access and ASP Developer
http://www.Bullschmidt.com/Login.asp - Database on the Web Demo
http://www.Bullschmidt.com/Access - Sample Access Invoices Database
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top