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
|
|||
|
|||
How to write the content of a formfield into a table
Hallo
I have one main form with two subforms, which are in relation 1:n to each other ( Kustomeradress1:nProjectdetails 1:nProjectwork). My first subform has in a field the following function to collect data from its subfield: =DSum("[Time]";"Projectwork";" [PPNr]=Projectdetails![PPNr]") PPNr is the Projectnumber. I would like to write down the DSum-Result into the table which is also called Projectdetails. What is the easiest way to do this? Best regards Peter |
#2
|
|||
|
|||
How to write the content of a formfield into a table
Typically, writing a calculated value back to the database is a violation of
Normalization rules, since you can always re-calculate the same result from existing data. There are some exceptions: 1. Where the data requires history and you are not storing the individual elements of the calculation. 2. Where the calculations are intense and require long computational times. If that is not the case, don't store the calculation. If it is the case, there are several ways: 1. Create an Insert (Append) statement and append the data to the table(s) 2. Add a bound textbox control which is normally hidden, and "push" data into it using the AfterUpdate event of each of the controls which comprise the calculation. -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads: http://www.datastrat.com http://www.mvps.org/access "Peter Höltschi" wrote in message ... Hallo I have one main form with two subforms, which are in relation 1:n to each other ( Kustomeradress1:nProjectdetails 1:nProjectwork). My first subform has in a field the following function to collect data from its subfield: =DSum("[Time]";"Projectwork";" [PPNr]=Projectdetails![PPNr]") PPNr is the Projectnumber. I would like to write down the DSum-Result into the table which is also called Projectdetails. What is the easiest way to do this? Best regards Peter |
#3
|
|||
|
|||
How to write the content of a formfield into a table
Arvin Meyer wrote:
Typically, writing a calculated value back to the database is a violation of Normalization rules, since you can always re-calculate the same result from existing data. There are some exceptions: 1. Where the data requires history and you are not storing the individual elements of the calculation. 2. Where the calculations are intense and require long computational times. If that is not the case, don't store the calculation. If it is the case, there are several ways: 1. Create an Insert (Append) statement and append the data to the table(s) 2. Add a bound textbox control which is normally hidden, and "push" data into it using the AfterUpdate event of each of the controls which comprise the calculation. Dear Mr. Meyer Due to your explanation I will not write calculated value to the table. But my problem is, that I want to have this calculated value displayed in a report. Now how can I do this exactly? Thanks Peter |
#4
|
|||
|
|||
How to write the content of a formfield into a table
"Peter Höltschi" wrote in message
... Arvin Meyer wrote: Typically, writing a calculated value back to the database is a violation of Normalization rules, since you can always re-calculate the same result from existing data. There are some exceptions: 1. Where the data requires history and you are not storing the individual elements of the calculation. 2. Where the calculations are intense and require long computational times. If that is not the case, don't store the calculation. If it is the case, there are several ways: 1. Create an Insert (Append) statement and append the data to the table(s) 2. Add a bound textbox control which is normally hidden, and "push" data into it using the AfterUpdate event of each of the controls which comprise the calculation. Dear Mr. Meyer Due to your explanation I will not write calculated value to the table. But my problem is, that I want to have this calculated value displayed in a report. Now how can I do this exactly? Create a query that includes the calculation, and base the report on the query, not on the table. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) |
#5
|
|||
|
|||
How to write the content of a formfield into a table
You have 3 choices:
1. You may duplicate your expression in a textbox on the report. 2. You can use a query as the recordsource of the report and create a query column using the expression. 3. If the form is always open when the report is run, and the report is a mirror of the data on the form, you can just read the value from the open form: =[Forms]![MyForm]![MyTextBox] -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads: http://www.datastrat.com http://www.mvps.org/access "Peter Höltschi" wrote in message ... Arvin Meyer wrote: Typically, writing a calculated value back to the database is a violation of Normalization rules, since you can always re-calculate the same result from existing data. There are some exceptions: 1. Where the data requires history and you are not storing the individual elements of the calculation. 2. Where the calculations are intense and require long computational times. If that is not the case, don't store the calculation. If it is the case, there are several ways: 1. Create an Insert (Append) statement and append the data to the table(s) 2. Add a bound textbox control which is normally hidden, and "push" data into it using the AfterUpdate event of each of the controls which comprise the calculation. Dear Mr. Meyer Due to your explanation I will not write calculated value to the table. But my problem is, that I want to have this calculated value displayed in a report. Now how can I do this exactly? Thanks Peter |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Table Analyser and more... | Mary Ann | Database Design | 2 | June 29th, 2004 06:36 PM |
using query to write to table | Troy Scott | Running & Setting Up Queries | 4 | June 11th, 2004 02:25 PM |
Appending to table if content doesnt already exist | Stuart | Running & Setting Up Queries | 1 | June 9th, 2004 03:05 PM |
resize table from A4 size to A5 | ims | New Users | 3 | June 9th, 2004 01:05 AM |
COMPARE THE TWO TABLES | Stefanie | General Discussion | 0 | June 4th, 2004 04:36 PM |