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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculator Control

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
Does anyone know if there is a calculator control that can be added to a form that would return the final value to a select field on the form?
 
MajP...both look reasonable. On the second one I think I will try to modify the equal code and have it place the final value in a pre-determined field.

Thanks for the help.
 
This is how I modified the second one.

In a public module place this function:
Code:
Public Function getCalcValue() As Double
  DoCmd.OpenForm "zDistCalculator", , , , , acDialog
  If CurrentProject.AllForms("zDistCalculator").IsLoaded Then
    getCalcValue = Val(Forms("zDistCalculator").txtDisplay.Caption)
    DoCmd.Close acforms, "zDistCalculator"
  End If
End Function

To use this function from anywhere such as a double click on a form or a cmd button.

Me.YourcontrolName = getCalcValue

Modify the close on the calculator to the following

Private Sub cmdClose_Click()
....
Me.Visible = False
'DoCmd.Close acForm, Me.Name
End Sub

Works real well and easy to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top