How can I perform currency addition in a form and store it in a t.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have made a form that adds the AIRFARE$+LODGING$+MISC$+CARRENTAL$, and
stores the answer under TOTAL$. It performs the addition correctly in FORM,
but in my TABLE only the airfare, lodging, misc, and carrental is being
stored, the TOTAL$ is not being stored automatically. I want to know some
expression or a way I can perform the addition in FORMS and store the data in
TABLE.
 
Normally, the result of calculations are not stored in the database. Since
it can be recalculated at any time, there is no point. In this particular
case there is no point whatsoever since all the elements of the calculation
are being stored. If you absolutely need to store it (like if a dumbass
threatens your job if you don't) you can do it by pushing the data in to a
bound field instead of pulling it into an unbound one. In the AfterUpdate
event of EACH of the elements write an event procedure like:

Sub AIRFARE$_AfterUpdate()
Me.TOTAL$ = NZ(AIRFARE$,0)+NZ(LODGING$,0)+NZ(MISC$,0)+NZ(CARRENTAL$,0)
End Sub

--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
This is how my data entry works. I open up a FORMS file called [Input form
for Orders]. I enter all the travel information needed to send people on
business trips, City Destination, Airport codes, Airfare, Per Diem, Misc, and
Car Rental, etc. That information is stored into a TABLE file called
[ORDERS]. I now have 2 other FORM files called [TAD WORKSHEET] and [TAD
ORDERS] that retrieve the information stored in TABLE [ORDERS]. [TAD
WORKSHEET] is a worksheet to send to a travel agency to make reservations and
[TAD ORDERS] is the official government travel document that they must show
that they are traveling under government orders. That is why I was needing
the TOTAL$ stored. I was hoping for a one-time execution, but it seems I
will have to duplicate the travelling addition two more times.
Thanks,
Stan
 
Back
Top