Saving Calculated Fields To A Table
Sep 14, 2006
I have a small Database that produces invoices, Each invoice could have 5 items on it which are compeleted at different Dates. (cutting hair in an OAP Home) Invoice to be produced at the end of each month which shows what happened each week. This will be generated for each person in the home. I can display all the information in a form when inputing the invoice information. I want a button to copy the invoice number the client name and the total of the invoice to a new table. The total of the invoice is calculated control on the form.
How do I do this??? can anyone help
I need a total in a table to substract payments from.
All Help will be much appreciated.
View Replies
ADVERTISEMENT
Nov 30, 2006
I keep getting caught up in the same point over and over again. I need to save a calculated field's calculation to a table field. The problem is how do I do this? I already know about the rules but I need to do this and store that specific information. Can someone post a sample code? The problem is the code and codes I been using dont' seem to work any more. I was putting
fieldname = textbox2.txt
in the form before update box. The problem with that is it would give me an error if the data source the calculation pulls from is not in the table/form.
View 1 Replies
View Related
Apr 20, 2007
I know that it is bad form to store a calculated field in a table - normalization and all that - but I can see no other way around a need that I have.
I'm trying to make a database to store injury time for employees. If an employee is injured, he can do light work for a certain amount of time, but this light work need not be contiguous. But, the total time on light work must be known so as to see when it is used up.
For example:
Bob is injured on 4/1/06 and goes on light work on 4/2/06 until 4/5/06 (4 days). Bob is then taken off light work until 4/10/06 when he reinjures the same injury. This does not count as a new injury, because it is an aggravation of the old one. So, Bob goes back on light work on 4/10/06 until 4/15/06 (6 days).
So, I need to store Bob's total time on light work for this injury (10 days) so that I can keep a running total to check against the maximum for a single injury. All I can think of is to store the sum of days on light work as a field in Bob's injury record, but that means storing a calculated field in a table.
Am I missing an easy way to do this, or is there a method to do what I want that I am just not aware of?
Thanx for any help!
View 2 Replies
View Related
Apr 26, 2007
Hi all,
I need to figure out how to have two calculated fields written to the database table instead of just being displayed in the form.
The user selects a number from 1 to 5 in the first field, and a number from 1 to 7 in the second field. The first calculating field multiplies these two numbers and displays the result. The second calculating field determines where the resulting number fits in three ranges of numbers and displays the result as Low, Medium, Or High.
My problem is the calculated results are be displayed in the form but not being written to the table. I cannot create a report to display all the High results, etc.
How do I update the calculation field formula to write the results into the table so I can create queries/reports on the calculated data?
Thanks,
bugleboy62
View 3 Replies
View Related
Sep 27, 2012
I have three columns where A is a number, B is a number and I want to make C = to the greater of the two. i.e.
Col A = 10, Col B = 12 therefore Column C = Col B or Col A = 12, Col B = 10 therefore Col C = Col A
View 4 Replies
View Related
Nov 29, 2005
I have a form created from a table and I had to use calculations in some of the fields to automate certain processes. Now, if I pull a report based on the fields in the table - I am getting all except for the fields with the calculations. Is there any way to update the main table - since most of the calculations were done with text boxes?
View 1 Replies
View Related
Aug 28, 2006
I need to display a value from a table in a text field on a form based on another text field on the same form.
The table has records as follows:
Month/Year xx Month No xx Year No xx Month ID (xx shows break in columns)
Jan-06 xx 1 xx 2006 xx 24
Feb-06 xx 2 xx 2006 xx 25
Mar-06 xx 3 xx 2006 xx 26
Apr-06 xx 4 xx 2006 xx 27
May-06 xx 5 xx 2006 xx 28
Jun-06 xx 6 xx 2006 xx 29
Jul-06 xx 7 xx 2006 xx 30
In one text field I use the DateSerial function to calculate the value of the previous month (e.g.Jul-06). I need to return the MonthID value to the second text field based on the value stored against it is the table, so in case of Jul-06 it would show 30 in text field 2.
View 1 Replies
View Related
Aug 5, 2006
Is there a way to make some of the fields from my form that contain calculated values carry to the table? Right now the values calculate correctly in the form but when I look at the table the field is blank...
I was hoping to use one form to calculate a value, insert it in the table, and then use that value in another form.
View 6 Replies
View Related
Aug 8, 2014
I am great with Excel but not soo much with Access 2010. I Excel, what I needed to do was very simple but duplicating what I did in Access is not soo easy.I am trying to calculate billings for FSA & HRA. I have set up one table with all the data. I want to add columns to the table to calculate:
1. Is there an account balance-excel formula:
2. If the account is still active
3. If the plan year run out is "active runout" or "runout over"
4. calculate each account type with a rate *count of FSA accounts = total to bill
Here are my excel formulas that for the life of me I can't get to work.
Account balance==IF(V2="HCRA",(IF(AB2-AD2>0,"Available Balance",IF(AB2-AD2=0,"Zero Balance","Negative Balance"))),((IF(AC2-AD2>0,"Available Balance",IF(AC2-AD2=0,"Zero Balance","Negative Balance")))))
Active runout/runout over=
=IF(AG2="YES","Active Runout",(IF(S2=W2,(IF(AF2>$AJ$1,(IF(AH2="Zero Balance","Runout Over","Active Runout")),"Runout Over")),(IF(AE2>$AJ$1,(IF(AH2="Zero Balance","Runout Over","Active Runout")),"Runout Over")))))
Active account=
=IF(D2<$AJ$1,"NO",IF(W2>$AJ$1,IF(S2=W2,"YES","NO") ,"NO"))
Can I have calculated fields that refer back to a calculated field?
View 10 Replies
View Related
Jul 26, 2012
I know that it isn't usually best practise to store calculated fields in a table, but in my situation it is necessary, and I haven't really found a good answer for this after searching these and other forums.
Currently my database has one "Name" field (I didn't make it like this) which might look like this "Jonathan (John) Smith"
Now I also have reason to grab the name like this "Smith, John" for other purposes.
I've set up a form for inputting new people with separate fields for firstname, preferredname, and lastname. I have the calculated fields:
=[fname] & " (" & [pname] & ") " & [lname]
=[lname] & ", " & [pname]
(Later I will add in all the iif's for if there is no preferred name)
Upon finishing the form, the user hits Submit, and I would like to store the concatenated values into the table in their appropriate fields.
I can do this with a SQL INSERT INTO statement but I'd have to add all 25 or so fields from the form, and injecting user input directly into a SQL statement is not best practice either.
View 2 Replies
View Related
Oct 16, 2014
How to store a calculated field into a table
I am preparing an invoice and I have a field called deposit .Now this field calculates %40 of the total of the order .but if the user wishes they can enter what they like .Now this field must be stored in a table for ever and a day and must not change or the invoice will be useless .I can see no other way of doing this and my research tells me (allen Brown) that this is sometimes necessary .
View 4 Replies
View Related
Mar 6, 2006
:rolleyes:
Please help! I am a newbie and VERY confused. I am not a programmer but am just learning so any help much appreciated! I'm not even sure if I've posted this to the right place?
I have so far created a table and also an asscoiated form - they both work! Changes in the form go into the table, no problem EXCEPT where I have a calculated field in the form - this info doesnt go into the table - how do I get this information to go back into the table?
I am trying to do this because I want to include the result of the calculated fields in a mail merge letter in Word (and Word wont pick up fields from my associated form - only from the table or from a query!)
Please rescue a damsel in definite distress (I've been knocking my head against a brick wall on this for 3 hours now!)
Many thanks in advance :D
View 5 Replies
View Related
May 29, 2014
I have two tables of data, each relating to three business branches (branches A, B and C).
Table 1 shows the expenditure of each branch (by fuel, premises and wages).
Table 2 shows a number of units for each branch (mileage, floorspace and sales).
What I would like to do is calculate unit costs, based on the expenditure in Table 1, divided by a relevant unit in Table 2. The catch is that I want to have a third table which allows the user to specify which expenditure (from Table 1) is combined with which unit (from Table 2) to generate the calculated unit costs. I've been able to do this in Excel, and have attached an example. I've also attached an incomplete Access version with the first two tables. Given the complexity of my actual data, I feel this could be better handled in Access than Excel.
View 6 Replies
View Related
Apr 27, 2006
My form gets its data from a single table. Each field on the form is linked to a field in this table.
Yesterday, running 'Docmd.Save' by clicking on a button saved the displayed data. Today, all of the fields are being saved, bar one.
I've checked that this field is still bound to the same table field and it is.
Could I have I inadvertently set some value that prevents this field being saved?
I'm at my wits end here. Any suggestions?
View 5 Replies
View Related
Sep 6, 2005
Morning All,
Just wondering.
When a form needs a calculated field. Say something simple, like
TotalCost = Quan*Cost
Is it better to create a query?
Use a table and create the calculated field in the query builder?
Or use a table and create a new unbound field on the form with the formula in it?
I never really know which one to do.
Lately I’ve been using saved queries for almost everything and now I have several dozen in this data base and its only half way done. Soon I’ll have to create a data base just to keep track of the queries in this one.
View 7 Replies
View Related
Aug 25, 2014
I have a transaction form and there is at least two fields I need to make sure have been entered before the record is saved.
I have no problem with text or numeric fields but I can't seem to be able to check the contents of a drop down field.
What is the best method to use to make sure a drop down has been selected by the user and contains a value.
I have temporarily used a default value in the drop down but that's not really what I want.
View 3 Replies
View Related
Sep 13, 2006
Hi,
I have read that it's not recommended to put calculated fields on a table and they should instead be calculated using a query.
How about if I need to store that calculated value in a table (e.g. field1 + field2 = value in field3)
How can I do that please?
Thanks,
B
View 5 Replies
View Related
Mar 26, 2008
I am trying to create a calculated field in a query, that shows money owed from customers. I have 4 different job codes that have their own prices. I also have customers with the amount of hours they owe for, for each job. There are two customers that owe for two different jobs. I know how to write in : Money Owed: [price per hour]*[number of hours]. but i want to have only one line for each customer when i run the query. How do i combine??
View 1 Replies
View Related
Aug 8, 2006
I have a detail form, which has controls populated from a query.
For example,
Name Number
xxxx xxxx
This can be any length depending upon the amount of database records, so there might be 5 names, or 4 names, etc.
I then need to sum these in the footer. Is the possible?
I just seem to get #Error displayed when doing SUM([ControlBoxName])
View 9 Replies
View Related
Sep 30, 2004
I have a calculated text box on a form:-
=[AnnualSavings]/[SKUAnnualSpendInPounds]*100
But, if both the Annual Savings and SKUAnnualSpendInPounds text boxes have a value of 0 the result of the calulation comes out as #Num!. I assume this is the error because I am doing 0 divided by 0.
Does anyone know if this is the reason for my error and if so is there anyway of changing the #Num! back into a 0 so that I can submit it to my tables.
Any help would be greatly appreciated
View 1 Replies
View Related
Apr 27, 2005
Here is my dilemma
I have a table called inventory that stores my different products and the quanitities i have in stock. I also have an orders table that handles a customer palcing an order for a certain product and the amount they want. What i want to happen is this: If a customer orders for example 5 widgets, I want my inventory table to automatically reflect the 5 widget deduction from the quantity in stock. Anyone know how to do this?
View 1 Replies
View Related
Mar 13, 2008
Im wondering how to make calculated feilds in a query?
Do i have to make the feild in a table the go to query?
View 1 Replies
View Related
May 18, 2005
I developed a query that calulates when a contract is reviewed i.e 5 weeks and 9 weeks after the commencement date. These are called CDE1 and CDE2. This works well and the CDE1 and CDE2 dates are displayed ok.
The query above is:
SELECT Contract.ContractNo, Contract.APSNo, Contract.Firstname, Contract.Surname, Contract.AgencyDesc, Contract.FacilityName, Contract.Designation, Contract.WeeklyHrs, Contract.PositionNo, Contract.ComDate, Contract.EndDate, IIf(DateAdd("ww",5,[comdate])<[enddate],DateAdd("ww",5,[comdate])) AS 1stCDE, IIf(DateAdd("ww",9,[comdate])<[enddate],DateAdd("ww",9,[comdate])) AS 2ndCDE
FROM Contract;
The problem is that I now want to access contracts under these CDE dates between two dates that is user defined (startdate) and (enddate).
As the above are calculated fields, how can I develop a new query based on the above as CDE1 and CDE2 are already calculated fields?
View 2 Replies
View Related
Aug 9, 2005
New to Access and learning the hard way. Im sure this is an easy one, but sure would appreciate the help. I am trying to sum a group of cells and display the total, which i have done. But I also want to store this total in my database. So my question is, how do i move my calculated total to my field that has the "record source" bound back to my field in the database? Hope that makes sense. Thanks in advance.
View 3 Replies
View Related
Sep 10, 2004
I have an Access 97 database with a form and a subform for invoice and invoice details. When I change the qty or price in the subform I have a calculated field on the main form that updates. I also have a button that when clicked brings up the payment screen with the totals from the previous screen. The problem lies when I change the qty or price and click the button right away, the next form pops up but does not take the new totals, it grabs the old ones. The calculated fields do not refresh fast enough. I have tried requery, refresh, and even a loop to make it wait before opening the payment form, but nothing seems to work. I'm at a loss. Any ideas would be appreciated
Thanks
Ken Reid
View 1 Replies
View Related
Sep 9, 2006
Now I can create a Query that adds, subtracts a specific column, but im having a hard time trying to get the information into a form since it don't seem to allow me to pick the query field which is calculated as a datasource. Can someone tell me how to make a calculated query column appear on a form as a field? Such if I type in monday in the regular table, the form will add a few days to the next available game? I have the information/code already in a query that displays the query right in a new table using the Expr method but I can't get the form to just simply display the field. Someone please help!
I see a few people asked close to the same question but nobody never answered so I am thinking it is impossible
View 3 Replies
View Related