need help filling a table with expression calculation

  • Thread starter Thread starter Marceia
  • Start date Start date
M

Marceia

Hello!

I have a table and form w/ 3 fields:

% applied to ded
Amount Billed
Amount applied to bill

on the form, in the control source, I have the following expression:

=[amount billed]*[% applied to ded]

the math works fine, but the problem I have is that the answer the
expression generates does not save in the table field Amount applied to bill
(the field the expression runs in).

how can I correct this?

thank you!
 
The way to do this is to set the value of the 'Amount applied to bill' after
updating either of the other fields on your form.

Reset the control source of the field to 'Amount applied to bill', and in
the After Update event of the other fields type
[Amount applied to bill]=[amount billed]*[% applied to ded].

Hope this helps.

Ian King
 
Thanks for the info!

When I do this, I get an error message that says the Macro doesn't exist.
There is no macro.

I've tried rephrasing the expression to =[Amount applied to bill]=[amount
billed]*[% applied to ded] but nothing happens.

I have this expression in all of the fields in the after update section. am
I doing something wrong?

thx again,

Marceia
Ian King said:
The way to do this is to set the value of the 'Amount applied to bill' after
updating either of the other fields on your form.

Reset the control source of the field to 'Amount applied to bill', and in
the After Update event of the other fields type
[Amount applied to bill]=[amount billed]*[% applied to ded].

Hope this helps.

Ian King


Marceia said:
Hello!

I have a table and form w/ 3 fields:

% applied to ded
Amount Billed
Amount applied to bill

on the form, in the control source, I have the following expression:

=[amount billed]*[% applied to ded]

the math works fine, but the problem I have is that the answer the
expression generates does not save in the table field Amount applied to bill
(the field the expression runs in).

how can I correct this?

thank you!
 
Hi,
What Ian meant was:
On the property sheet for the controls, select the Event tab.
click to the right of the After Update event and select:
[Event Procedure] then click on the elipsis (...)
This brings up the code editor.
type in:
[Amount applied to bill]=[amount billed]*[% applied to ded]

However, you shouldn't be storing this value at all. You can simply
calculate it
anytime you need to display it.

--
HTH
Dan Artuso, MVP


Marceia said:
Thanks for the info!

When I do this, I get an error message that says the Macro doesn't exist.
There is no macro.

I've tried rephrasing the expression to =[Amount applied to bill]=[amount
billed]*[% applied to ded] but nothing happens.

I have this expression in all of the fields in the after update section. am
I doing something wrong?

thx again,

Marceia
Ian King said:
The way to do this is to set the value of the 'Amount applied to bill' after
updating either of the other fields on your form.

Reset the control source of the field to 'Amount applied to bill', and in
the After Update event of the other fields type
[Amount applied to bill]=[amount billed]*[% applied to ded].

Hope this helps.

Ian King


Marceia said:
Hello!

I have a table and form w/ 3 fields:

% applied to ded
Amount Billed
Amount applied to bill

on the form, in the control source, I have the following expression:

=[amount billed]*[% applied to ded]

the math works fine, but the problem I have is that the answer the
expression generates does not save in the table field Amount applied
to
bill
(the field the expression runs in).

how can I correct this?

thank you!
 
Back
Top