A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Saving calculated field results.....a newbie question!



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2005, 12:20 AM
S Kahn
external usenet poster
 
Posts: n/a
Default Saving calculated field results.....a newbie question!

Reviewing the posts I realize it is not possible to save results of a
calculated field in a table. Besides I understand it is not a good practise
either. However my dilemma is that I want to use the result of a calculated
field in a Word document (using mail merge). Since the result is not stored
in a table, I am at a loss as to how to do so. Any suggestions would be
greatly appreciated (pls. remember my newbie handicap).
Thanks in anticipation,
SK
  #2  
Old September 1st, 2005, 12:31 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

It all depends on how the calculation is derived. If it's a fairly
straightforward one, you can add it as a calculated field in a query and use
the query with your mail merge instead of a table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"S Kahn" wrote in message
...
Reviewing the posts I realize it is not possible to save results of a
calculated field in a table. Besides I understand it is not a good
practise
either. However my dilemma is that I want to use the result of a
calculated
field in a Word document (using mail merge). Since the result is not
stored
in a table, I am at a loss as to how to do so. Any suggestions would be
greatly appreciated (pls. remember my newbie handicap).
Thanks in anticipation,
SK



  #3  
Old September 1st, 2005, 12:39 AM
Ofer
external usenet poster
 
Posts: n/a
Default

First, it is possible to store calculated result, but it's not recomanded.
To pass values to a word document, if you want to consider using bookmarks
then try this

Create reference to microsoft word, when you view code select tools
refernce and add from the list Microsoft Word
Then create A word document, insert book marks where you want the value from
access should be insert, and then run this code

Public Sub PrintToWord()
Dim wd As Word.Application
Dim myDoc As Word.Document

Set wd = New Word.Application
wd.Documents.Add DOTpath & reportName & ".dot" ' The name and path
Set myDoc = wd.ActiveDocument
With wd.Selection
.GoTo wdGoToBookmark, Name:=BookMarkName ' The name of the book
mark
.Font.Bold = True ' You can choose if bold
.Font.Underline = False ' or underline
.TypeText Text:=ValueToInsertInTheBookMark ' insert values
End With
wd.Visible = True

End Sub

"S Kahn" wrote:

Reviewing the posts I realize it is not possible to save results of a
calculated field in a table. Besides I understand it is not a good practise
either. However my dilemma is that I want to use the result of a calculated
field in a Word document (using mail merge). Since the result is not stored
in a table, I am at a loss as to how to do so. Any suggestions would be
greatly appreciated (pls. remember my newbie handicap).
Thanks in anticipation,
SK

  #4  
Old September 2nd, 2005, 03:22 AM
S Kahn
external usenet poster
 
Posts: n/a
Default

Thanks for the advice. The calculation I put in the query is:
Datediff("d",[DOB],Now()) where [DOB] is another field with the date of
birth. However it does not seem to work despite many pertubations that I
tried.
Again thanks for your help.
SK

"Douglas J. Steele" wrote:

It all depends on how the calculation is derived. If it's a fairly
straightforward one, you can add it as a calculated field in a query and use
the query with your mail merge instead of a table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"S Kahn" wrote in message
...
Reviewing the posts I realize it is not possible to save results of a
calculated field in a table. Besides I understand it is not a good
practise
either. However my dilemma is that I want to use the result of a
calculated
field in a Word document (using mail merge). Since the result is not
stored
in a table, I am at a loss as to how to do so. Any suggestions would be
greatly appreciated (pls. remember my newbie handicap).
Thanks in anticipation,
SK




  #5  
Old September 2nd, 2005, 03:27 AM
S Kahn
external usenet poster
 
Posts: n/a
Default

"Ofer" wrote:
First, it is possible to store calculated result, but it's not recomanded.



Firstly, thanks for the advice. You suggested that it is possible to pass
results from a calculated field to a table (though not recommended).
Appreciate if you could advise how I could do that.
SK




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically select value from a calculated field jimmy0305 General Discussion 1 June 21st, 2005 08:10 PM
getting a report to recognize a calculated field as a number Paul James Running & Setting Up Queries 4 January 20th, 2005 04:41 AM
Calculated Field Problem: Picking a date based on value in another field Dkline Database Design 3 June 23rd, 2004 04:05 PM
NUMBERING the pages Bob New Users 7 June 14th, 2004 12:20 AM
2 Qs: Calculated Field & Composite Unique Index David F New Users 2 June 6th, 2004 09:03 PM


All times are GMT +1. The time now is 04:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.