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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
"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 | |
|
|
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 |