Name a text field containing formulas

  • Thread starter Thread starter 9568dc
  • Start date Start date
9

9568dc

I created a text field on a form that contains a formula. I did this a
second time. Now I want to calculate the two fields in a third field without
typing out all of the two formulas. I only want to use the name of the two
fields. How do I name the two fields?
 
9568dc said:
I created a text field on a form that contains a formula. I did this a
second time. Now I want to calculate the two fields in a third field
without
typing out all of the two formulas. I only want to use the name of the two
fields. How do I name the two fields?


I don't quite follow you, David. The calculated controls you created have
names -- Access would have assigned them names when they were created, and
either you subsequently renamed them or they still have the original names.
Check the Name property of each control, which will be found on the Other
tab of the control's property sheet in design view. Those are the names you
should use.
 
You can name them anything youy want (except reserved words) then put the
mathmatical expression you need to calculate the two fields in the control
source of the third field. Example in control source of third textbox:
=[Formula1] + [Formula2]
Where Formula1 is the name of the first textbox and Formula2 is the name of
the second textbox.

Steve
(e-mail address removed)
 
This is the typical case of 'chicken and egg - which came first'.
When you did your calculation you gave them aliases and now want to use them
instead of the orignal math.

If Access in processing your SQL statement comes upon the alias before it is
create then it is an unknown so far as it is concerned.

It seems to me that Access processes the SQL from the bottom up - not real
sure if it hold true all the time.

If your SQL was written like this it might function --
SELECT [Alias_1] + [Alias_2] AS [Alias_3), [Field_1] * 1.5 AS [Alias_1],
[Field_2] + 0.015 AS [Alias_2]
FROM YourTable;

But if your SQL was written like this it might not function --
SELECT [Field_1] * 1.5 AS [Alias_1], [Field_2] + 0.015 AS [Alias_2],
[Alias_1] + [Alias_2] AS [Alias_3)
FROM YourTable;
 
Back
Top