Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to get Calculation from Query to Table, then to Word

Status
Not open for further replies.

ramsenisaac

Technical User
Oct 5, 2003
4
US
I'm VERY new at MS Access

I created this calculation in Query
[Purchase Price]/500

It now shows up, in Query, as Expr1:[Purchase Price]/500

I need the result of [Purchase Price]/500 as a field in my MS Word document which has many other fields from my Table...

How do I get the result of [Purchase Price]/500 from the Query into the Table?

Should the calculation be done in the Table instead of the query? If so, how?

Thanks.
 
Hi

You are on the right track, the valculation should be done in the QUERY not the table. The bais idea is if you can calculate a value why store it?, sometimes for reasons of perfprmamnce or whatever we need to bend this rule but if you start from the correct point you will not go far wrong. As to how you agt at the remainder of the columns in your table, you simply include them in the query, then use the query to 'feed' your word document. It is difficult to comment on how you actually get the data into a word document without knowing just waht youa re trying to do, this could be via a mail merge, or via an Access report output as a .rtf, or you can use word automation to create a word document from within Access

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi, thank you for replying.

The reason I need to display the calculation is because a local government form requires the calculation to be shown. :)

Ok, so when I try to merge the information in Query1, then my Word doc says that I have changed data sources so that I cannot merge the information I need from my Table. It seems like the form will only access the Table OR the Query within my database.

Also, I have managed to figure out how to have the calculations show up in my Form within this same database (Properties of Form Textbox->Data Tab->Control Group-> inserting an equation) ... but I still cannot get this calculation into my Word doc via merge.

So now I have the calculation result in Query and in Form, but not in Table, and the Word Doc accesses the Table to get the info...

ramsenisaac
 
Hi

So you are using a Mail merge to get the data into word, so as I said in my first post, make the query include all of the fields you need (or if necessary all of the fields in the table, by using the * option, plus the calcualted cilumn, then do the merge using the query, rather than the table.

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top