Store Calculate Values
Sep 29, 2005
I searched the archive for how to store a calculated value and found a lot of controversial dialogue about the pros/cons but not really a solution on how to do it.
I have a form based on a query. The database behind the form and query is our ERP database and is connected though an odbc connection. The form allows the user to enter some shipping dimensions and freight rates. The data is automatically stored in the ERP database and any user can view the data from the ERP software.
Here is the problem. There are also some freight calculations that occur on the form that our business teams want the results stored in the ERP database. They can view the results from the calculations using the ERP software instead having to open a 2nd application (Access form) to view the calculated data.
I have determined which fields in the ERP database will hold the data. I only need the vb code or other suggestions on how to update the calculated values into the database.
I apologize for the long message. Thanks for your help,
Jeff
View Replies
ADVERTISEMENT
Nov 11, 2012
We are collecting data from client files that have multiple dates (start_date, event1_date, event2_date, end_date.) For client protection purposes, we are absolutely not allowed to leave the facility with the actual dates. However, we want to know how many days have passed between each event. I thought about having the data collectors enter each date, have a calculated field store the time between dates, and then have the actual dates cleared when the record is saved or when the person moves to the next record.
View 14 Replies
View Related
Jan 11, 2006
Hi all,
I was thinking/hoping of using a list box on my form to store multiple values, I haven't been able to find a way of storing any value so far so not sure how easy it will be?
How can this be achieved or is it just easier to use several check boxes (approx 8)
Thanks
View 3 Replies
View Related
Sep 23, 2014
I am trying to perform a calculation within an IF then Statement. The difference is I need Access to remember a values to complete the calculations prior to setting the final answer. I think this is basic however I am a novice and can't seem to get it to work.
Code:
If [Forms]![Jobentryfrm]![StyleJobCurrentSub]![Assembly] = 39 Then
BL = ([Forms]![Jobentryfrm]![Height] * 2) + ([Forms]![Jobentryfrm]![Length] * 2) + 8
bw = [Forms]![Jobentryfrm]![Length] + [Forms]![Jobentryfrm]![Width] + 12
[code]....
View 4 Replies
View Related
Nov 22, 2013
I'm building a database to organize the editing of a massive report my office is working on. I've got a big table of all the sections. Each section has a unique ID and a version number. I wrote the queries so that they return only the most recent version (i.e. the Max version # of each section.) The results of the query appear in a subform.
I was able to use VBA to allow the user to double click on the record in the subform, and look at the record in another form. (I was really proud of this.)
Anyway, it turns out what I need is to double click on the record in the subform, and create a new record based on this record, but increment the version # by one.
I've created an unbound form for this, and googled around. I need to use VB to store the variable, and then put it in the unbound text box.
View 11 Replies
View Related
Jul 20, 2015
I am trying to get a value from a textbox into a table I created...
The textbox "calculates a number based on which radio button is pressed example if radio button 1 is pressed it returns 0 if radio button two is pressed it returns 8 and if radio button 3 is pressed it returns 15." I need to save the 0,8, or 15 depending on which radio button is pressed into the table...
I know you aren't supposed to store calculated values into a table but the report would never need to be changed and it just saves a new one each time with that being said anyway to make this work would be very useful!
Also how can you use the answer of calculated textboxs in other calculations?
View 14 Replies
View Related
Mar 12, 2014
Basically, what's the best practice or how do we store a query's value into an array then checking what the max or min value is and how to check if let's say "4" is in the array?
View 1 Replies
View Related
Jul 17, 2006
How do I calculate the values between two columns and populate a third column with those new values? I have an ''Actual Cost'' column and ''Budget Cost'' column and I would like to create a third column ''Margin.''
Is this something that needs to be done with a query or can it be handeled in the design view of a table? I'm starting to learn that Access works nothing like Excel.
Thank you in advance for any help. I scanned some of the threads in this forum, but many were beyond my comprehension. Any walk-through of this procedure would be much appreciated.
View 1 Replies
View Related
Feb 3, 2005
Hi all -
I need to create record totals and grand totals on a report where I count up the # of Yes's and No's across 10 fields. I've already created calculated text boxes that come up with the record totals. What I can't figure out for the life of me is how to create a text box calculating the grand total based on the previous calculated fields I created. It seems that access isn't letting me sum a field I created on the report. Do I have to create a query first? Thanks.
View 3 Replies
View Related
Aug 6, 2007
I have parts that go into and out of inventory. Each time a part is removed or returned, the user inputs the number into the computer. I was wondering how I could link the numbers so that as parts were removed or added, the total number in inventory and the total number on the floor automatically changed. Thanks so much.
View 1 Replies
View Related
Jul 12, 2005
Hi everybody. I got a access 2000 query that lists :
1)weekno
2)year
3)project (project number )
4)QweekylyReportHeader (project description )
5)customer (customer that requested this project)
6)department (department number and name that implements this project)
7)Projectleader ( project leader name and number that is responsible for this project)
8)Task (Task number that is done for this project )
9)task description (description of task )
10)employee ( employee number who is working in this project )
11)name (Employee name and initial and last that works for this project )
12)hours ( number of hours employee worked in this task ) ==> i want cumulative for this
13)salary (amount of salary given to this employee) ===>i want cumulative for this
I want to create another query that lists :
A)cumulative value of hours worked on particular project task up that point.
b)cumulative value for wages given for that project task up that point.
http://i5.photobucket.com/albums/y180/method007/weeklyprojectdata2.jpg ( query output sample)
The above query ONLY lists hours worked and wages gives for particular project task only during
each week.But i want hours worked and wages give for particle project task up to that point in week. For
example a project task might have implemented last week but not this so i want to take that in calculation as well.
I be happy if some expert show me how i can calculate the cumulative value for hours worked and wages given for particular
project task.
Notes:
- There is a possibility that during a particular week no task been implement for particular project.
- One employee can work in more then one project
- One employee can have more then one salary (amount) for the same
project because he might get raise in salary!
- Only tasks carried this week will be printed in the weekly report
http://i5.photobucket.com/albums/y180/method007/constraint.jpg ( pic of database)
http://i5.photobucket.com/albums/y180/method007/hourlywagesroportfinal.jpg ( query output population)
http://i5.photobucket.com/albums/y180/method007/queryindesign.jpg (query in design view)
query that display hourly wages of certain project during each week
SELECT
querythisweek.weekno,
querythisweek.Year,
querythisweek.Project,
QweeklyReportHeader.Customer,
QweeklyReportHeader.Department,
QweeklyReportHeader.description,
QweeklyReportHeader.ProjectLeader,
querythisweek.Task,
dbo_Task.description,
querythisweek.Employee,
[lastname] & ' ' & [initials] & ' ' & [insertion] AS Name,
querythisweek.hours,
querythisweek.Salary
FROM
dbo_Task
INNER JOIN ((QweeklyReportHeader INNER JOIN querythisweek ON QweeklyReportHeader.projectno = querythisweek.Project) INNER JOIN dbo_Employee ON querythisweek.Employee = dbo_Employee.employeeno) ON dbo_Task.taskcode = querythisweek.Task;
code for querythis week( calcualte the salary and hours worked)
SELECT dbo_Hours_worked.Project, dbo_Hours_worked.Year, dbo_Hours_worked.weekno, dbo_Hours_worked.Task, dbo_Hours_worked.Employee, dbo_Hours_worked.hours, (select a.amount * dbo_Hours_worked.hours
from dbo_Hourly_wages a
where dbo_Hours_worked.Employee = a.Employee
and dbo_Hours_worked.Project = a.Project
and a.Year * 100 + a.weekno = (select max(b.Year *100 + b.weekno)
from dbo_Hourly_wages b
where b.Year < dbo_Hours_worked.Year
or (b.Year = dbo_Hours_worked.Year and b.weekno <= dbo_Hours_worked.weekno))) AS Salary
FROM dbo_Hours_worked;
View 5 Replies
View Related
Feb 22, 2014
I have a table where there are multiple vehicles, each identified by their vehiclenumber. Each record holds the vehiclenumber, date and odometer reading. I need to figure out how to calculate records in this table per each vehiclenumber.
Below is a code that works, but only when i have each vehicle with the same vehiclenumber.
SELECT tblOdometer.VehicleNum, tblOdometer.ODate, tblOdometer.Odometer, tblOdometer.Odometer AS OdomAlias,
Nz(DLast("Odometer","tblOdometer","[Odometer] < " & [OdomAlias]),0) AS Previous, [Odometer]-[Previous] AS Difference
FROM tblOdometer;
View 4 Replies
View Related
Aug 13, 2013
Is there any formula or any way to calculate moving average on access? What I need is to calculate a value based on data from the past 3 months:
I have following structure for example:
Column A ----- Column B -------- Column C
ValueA1 ------- Value B1 ---------
ValueA2 ------- Value B2 ---------
ValueA3 ------- Value B3 --------- =average (ValueB1, valueB2, valueB3)
ValueA4 ------- Value B4 --------- = average (valueB2, valueB3, valueB4)
My main point id how to calculate values for column C.
View 1 Replies
View Related
Aug 10, 2015
How to set up my tables as I'm just starting off with setting my database up.
I'm doing a simple database to track the purchase orders (PO) I am managing. Each PO has a PO Number and an Original Value. POs may have multiple amendments which would change the PO value. I would however like to keep the history of the PO original value and all different amendments.
So I created two tables:
tblPO:
ID
PO Number (Number)
PO Original Value (Currency)
PO Sum of Amendments (???????????)
PO Current Value (Calculated = PO Original - PO Sum of Amendments)
tblPOAmendments:
ID
PO (Lookup from tblPO)
PO Amended Value (Currency)
Amendment Date (Date/Time)
Amendment Desc (Text)
Now the two, million dollar questions are:
1.) Is this the right table structure to use.
2.) How do I go about calculating the Sum of Amendments field?
View 4 Replies
View Related
Oct 7, 2013
I have several projects with different tasks for each. I have 3 fields [fkProjectsID], [TaskOrder] and [Duration] in a table for project tracking with that structure:
[fkProjectsID] [TaskOrder] [Duration]
1 /1 /5
1 /2 /8
1 /3 /15
1 /4 /6
2 /1 /8
2 /2 /30
2 /3 /25
I want to calculate cumulative values stored in [Duration] field (represent a number of days). I'm using the field [TaskOrder] to order different tasks within each project. With some testing, I was able to calculate cumulative [Duration] with 1 project using the DSum fucntion as following:
CumulDuration: DSum("[Duration]", "[tblProjectTracking]", "[TaskOrder]<=" & [TaskOrder])
I was having the sequence: 5, 13, 28, 34 for respectively Task 1,2,3,4. However, when I add a second project (and then a third...), I need to be able to filter based on [fkProjectsID] as well (i.e. a specific DSum by ProjectsID). I add this criteria but I get the sum of [Duration] on each row instead of the cumulative:
CumulDuration: DSum("[Duration]","[tblProjectTracking]","[TaskOrder]<=" & [TaskOrder] And "[fkProjectsID]=" & [fkProjectsID])
View 3 Replies
View Related
Nov 27, 2014
I am struggling with calculate difference between two query table values, I first created a make a table query(current meter reading) which contains one column called "meter read" , and I created a second make a table query(previous meter reading) which also contains "meter read" column, I linked those two make table queries to calculate the value difference between two date, how can I create a form to calculate diff between any two date?
View 3 Replies
View Related
Nov 18, 2011
I have a problem in doing a task with my form. Actually I have a button to add a new record which opens a new form there i enter the values to the record. But when I press the Addnew record button I want to calculate the maximum of the Identity field +1 and open the new form with that new number which i have calculated. How can i do this....
View 1 Replies
View Related
Mar 19, 2012
I have a MS access table with 12 numerical columns for 12 Months payments for our customer base.
I need to calculate variance of payments month on month and identify set of customers who have made huge payments.
View 10 Replies
View Related
Jan 9, 2006
if you are asked to store only the month, or only the month and year, how do you do it? tnx.
View 3 Replies
View Related
Jul 9, 2007
I was once told that Access does not like to store calculated values but I would like to.
Here is my expression: =([Shift Lenght]-[Total idle time]-[Total down time])/([Shift Lenght]-[Total idle time])*(0.33*[Total pc])/([Shift Lenght]-[Total idle time]-[Total down time])*([Total pc]-[Total scrap])/([Total pc]+0.1)*100
This gives me the value that I desire, now I need to store it in the table with the rest of the records data.
I am planing on storing 3 -4 expressions like this and then averaging them.
Then building a query to the averages for the day,week,month, and year.
Please be gentle I am not very familiar with access but learning a lot:)
View 7 Replies
View Related
Mar 17, 2005
Hi hope someone can help,
What I’m trying to do is work out price per quantity, at the mo I have a database that has products and price so lets take paint for an example.
If I have a 5 litre pot of paint and I’m selling it for £10 I would like a field that tells me the price per litre, so what I’m think I need to do is have a field called ”price” and divide it by a second field called “quantity” and output the sum to a third field called “price per litre” which populates the database.
Sadly I haven’t got a clue how to do this with access and if anyone can help it would be much appreciated.
Thanks
View 1 Replies
View Related
Jan 12, 2005
In everyones opinion what is the best way to handle picture uploads in an Access database?
One picture for one employee, where should I store the pictures. I know that keeping pictures in the database eats up space and really can slow ya down. Make a new folder just for pictures??
Thanks fellas and ladies.
View 2 Replies
View Related
Jan 15, 2005
Ok I know everyone is going to say you should not store calculations, but I have no choice!!!!!!!!!! I have the form ORDERFORM (recordsource ORDERS table) with a subform ORDERFORMsubPROD (recordsource ORDERSPROD table). Essently theses 2 forms togather allow me to place an order for multiple products and store them in the ORDERS (key: ORDERID) and ORDERSPROD (foregin key: ORDERID) tables. The ORDERFORM includes information such as an ORDERDT and the ORDERFORMsubPROD includes a sum of cost the products ordered which is shown in ORDERFORM with a boundcontrol = to the ORDERFORMsubPROD control that does the actual calculations.
Next I need to be able to pull specific informtaion from the ORDERS table and group it togather by the SALESMANID. To this end I have a form SALESMAN with a subform SALESMANsubORDERS that displayes the ORDERID, ORDERDT, and the calculated sum of the products ordered on that ORDERID based on the SALESMANID of the order.
So far everything stated above is correct and should not require that I store calculations. My problem comes in when I am trying to make a form that will filter this information based on user supplied criteria (my user does not want to have to use the filer buttions supplied by Access). I'm using DoCmd.OpenForm and setting my WHERE criteria based on a bunch of If .. Then statements that check the various filter text/combo boxes to determine if they are populated and then admend the WHERE statement accordingly. At least that is how it works on a very similar form that filters ORDERFORM. I have discovered that because the subform, SALESMANsubORDERS, is based on a query that includes calculations the WHERE statement needs to be phrased as HAVING. I can not figure out how to get Access to comply with this so all I can think of is to store the calculated values (and be able to allow them to be updated later) then pull them directly from the ORDERS table.
Anyone who can write precise/generic code and most importantly tell me where (what event) that code should be placed on please let me know. This is the first time I have run into this problem and it is really my last problem before completing a DB application that needs to be completed by Wed 1/19/2005. Thanks in advance for any advise/help I receive.
View 1 Replies
View Related
Oct 7, 2007
NE1 help me with this?
I want to store some pdf drawings in an mdb.
I want to be able to search just by the file name of these drawings.
I want to be able to click on any one of the file names I find and have adobe display the file.
I want to compile this into an mde to make it a stand alone app.
I can do this using asp on a web server. But I can't seem to figure out how to do it just using access without asp.
View 2 Replies
View Related
Apr 12, 2006
Hi
I am creating a contact management database.
I have set it up and now need to create an invoice section. An invoice needs to be issued every month and is worked out on a percentage of works complete. For example in one job there may be 10 items of work and for 8 of these iems 25% of the work is complete and the other 2 no work has started.
Therefore my invoice needs to be able to calculate 25% of the value of the 8 items and work out a total price to be invoiced. Each time an invoice is created I need to be able to store the invoice value and the percent value of each item complete.
Does any one have any ideas as to a good way of doing this. That is if you can undersatnd what I am asking for. Thanks for any help.
View 2 Replies
View Related
Jun 30, 2005
I have a handful of misc. data that is unique an really doesn't fit anywhere... I need it to be easily updateable, as it will and needs to change from time to time, What should I do with it?
Some of the data is a "Common Footer" that prints on ALL reports and DOES change periodically. I decided to create a common footer table with a single value and can access it from all of my reports... it works great!
However, I now have a bunch of other misc. data that I need to store, like the "Working Year" (I am going to use the field to dictate which year of info to pull the data from) "Common Header", etc. Additionally, I am considering storing formatting data such as font size (still considering this).
So with all this explained, to sum it all up, what is the best method for handling all of this misc. data? I didn't think creating a separate table for each piece was the best idea.
Thanks for your suggestions!
View 1 Replies
View Related