Adding 2 fields

B

Bruce

I have information in the same table but in seperate fields, how can I add
the contents of one to the other?

Field = Projects + Field = RSS No


Thank you

Bruce
 
R

rpw

Hi Bruce,

If you are wanting to create a new field in your table and update it with the data from two other fields, then consider not doing that. It becomes redundant data and it is also a 'calculated field' - both of which are not considered to be good table design. However, you can do the 'calculation' on a form or a report and view the the information the way you want to see it.

For example, let's say that on your form you have two textboxes. One textbox is named is "txtProjects" and the other is named "txtField". On this form you place new textbox, name it txtProjectField and in the control source property of the new textbox you type:

=[txtProjects]&" - "&[txtField]

When the form is in from view, the new textbox will display something like this:

"RSS - 123"

If you don't want the dash between the two bits of data, write the formula like this:

=[txtProjects]&" "&[txtField]

and it will display "RSS 123".

Hope this helps.
 
T

Tim Ferguson

I have information in the same table but in seperate fields, how can I
add the contents of one to the other?

Field = Projects + Field = RSS No

In a query. You really don't want to store all three fields.

Tim F
 
B

Brad Rosevear

I want to do the same thing. But the same table will have more
calculation in it. If I can get the first to work then I can figure out
the rest. I want to creat a field "X" and this field will equal "A" +
"B" + "C" -"D". Can somebody help me with the correct syntax?
Thankyou.
Brad
 
R

Rick Brandt

Brad Rosevear said:
I want to do the same thing. But the same table will have more
calculation in it. If I can get the first to work then I can figure out
the rest. I want to creat a field "X" and this field will equal "A" +
"B" + "C" -"D". Can somebody help me with the correct syntax?

There is NO way to create a field in a table that holds a calculation and there
is no good reason to try. Build a query that has all of the fields in your
table PLUS a calculated field that uses the expression that you want. Then just
substitute the query any place you are currently using the table.
 
R

rpw

Brad,

Can you explain a little more about your need? Is there a reason for storing the results of a calculation in the table? What do "A" and "B", etc. represent - tables, field names, numbers, text, what?

Also, what Rick Brandt stated about having a field in a table do the calculation is correct, although there are methods of updating a table with the results of a calculation. In MOST cases, storing the result of a calculation is redundant and considered to be non-normalized table design, however, there are times when it is advantageous to do so.

Post back to this thread and we'll try to help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top