How do I calculate a percentage of a filed value in a query?

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

Guest

Hi
I have a field titles rtnfare need to calculate owfare where ow fare is 60%
of rtnfare value. How do I do this please?
 
if i am understanding you correctly the it should just be
=([rtnfare])*.6 in the control source of the owfare.
 
did that work for you? also are you trying to get this calculation in a
query or a form. my be easier to run it from the form. i was basing
this off of using a form.

thanks
 
if i am understanding you correctly the it should just be
=([rtnfare])*.6 in the control source of the owfare.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No. That is just the formula to find a percentage of a value.

Usually, a calculated value is not stored in a table, it is calculated
during a query run or in a report. Or, you can put it as you have,
above, in a control, but that value will not be saved to the table 'cuz
it is an unbound calculated field.

If you want to save the percentage to the table (which I don't
recommend) you can use the Form's BeforeUpdate event procedure:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If Not IsNull(Me!rtnfare) Then Me.owfare = Me!rtnfare * .6

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQlcpQIechKqOuFEgEQKbEgCfRy+xICHa1qTEUOxshBKFTDSewpIAoJ30
nZLt3ERT4GlvhRarLklQV1mk
=4bCK
-----END PGP SIGNATURE-----
 
Back
Top