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

Calculations?

Status
Not open for further replies.

NewfieSarah

Programmer
Joined
Feb 7, 2005
Messages
147
Location
CA

I have a new table called CONRESVALCALC with contain lots of fields. I need to use a command buttons so when the buttons is clicked then a calculation is performed for that specific button. The field Mainarea and unitval have to be multiplyed to have portionval appear. This button can be pressed anytime when adding a new record. or editing. suggestions?? Thanks

sarah
 
I use the following method:

1.) Create your button on the form
2.) In the OnClick event of the button put the following code:

Code:
me.portionval.visible = True
Calculate


Add the following procedure in the form

Code:
Private Sub Calculate()
    Me![portionval] = Nz(Me![mainarea], 0) *  Nz(Me![unitval], 0)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top