Forms :: Calculating Field Value

Jan 31, 2015

calculating a field value.I've got 5 products, numbered 1 - 5 in tblProducts.productID..In one order I'll only ever have the 1 - 5 products, with a maximum of 5 products in any Order.

products
1 = mushroom
2 = tomato
3 = egg
4 = fish
5 = meat

tblOrder.orderID
tblOrderDetail.productID
I have a field in tblOrderDetail called "productNumber" which is where the result should go of the calculation.

I need to calculate the total number of products ordered but it could be a combination of them, the thing is that I need to reference them in a specific order if they exist in the order as per the schedule above.

example
order 1 = products 1,3,4

the result should be
1.3 (mushroom)
2.3 (egg)
3.3 (fish)

example 2
order 2 = products 1,4

the result should be
1.2 (mushroom)
2.2 (fish)

example 3
order 3 = products 4,1 (this one shows that we haven't ordered it in order, I still need to display that correct order)

the result should be
1.2 (mushroom)
2.2 (fish)

View Replies


ADVERTISEMENT

Calculating Field Based On Value Of Another Field In Previous Record

Sep 18, 2014

I'm trying to create something like an online banking view that shows the running balance as each transaction occurs. I have tblTransactions with fields AccountNumber, ItemDescription, and TransactionAmount. I'm trying to create something that shows these three fields and a fourth field with the running balance.

So if I initially deposit $100 it will show the first record with TransactionAmount = $100 and RunningBalance = $100. Then the next transaction will subtract the Transactionamount for the new record from the RunningBalance from the previous record to get the RunningBalance for the new record. So if I make a purchase for $2, the AvailableBalance for that record is $98. Is this possible with a query? Here's a picture to describe what I'm talking about ....

View 3 Replies View Related

Calculating New Field

Feb 26, 2008

Hi I'm building database for a car shop. One of my table (Cars) has these two fields in it intModelPrice (which stores factory price of a model) and intPriceWithTax (which value should mathematicaly be intModelPrice+[(intModelPrice)*(18/100)]).

Now, can I set my default value of intPriceWithTax to be calculated by this formula and how? I tried some combinations but I got various error messages.

I red Tips section on your site and saw that default value can't be calculated. I know how to get what I want in the select query but I want this table field (intPriceWithTaxt) to be acctualy filled with number value each time I enter a new record in this table (for a new car model). How do I acomplish this? Thanx.

P.S. - I searched the forum for answer but I had no luck.

View 11 Replies View Related

Calculating AGE From DOB Field

Nov 25, 2012

How to calculate present age automatically using DOB field. I have created 2 fields DOB and AGE. But everytime i am calculating AGE and then manually typing in AGE field.

View 1 Replies View Related

Queries :: Calculating Membership Fee From A Field In Another Table?

May 8, 2013

I've made a membership database for an imaginary leisure centre as part of my A Level coursework - only after more or less finishing my project, I've realised that I haven't provided a way for the end users to calculate fees for members.

I suppose the calculation I would have to do is multiply the Length of Membership (days) field on the Membership Opportunities by Cost per Month on the MembershipTypes table.

These are the relevant tables and I've also attached my database (the password is "password" for any of the users) ...

View 1 Replies View Related

Tables :: Auto Calculating Field In Table

Jul 29, 2015

Currently I have a form with these variables

- Assets
- Shifts
- Machine Offline Date
- Machine Offline Time
- Machine Online Date
- Machine Online Time

In the Asset Table I have recorded on each asset the number of shifts it operates for as well as starting / finishing time of those shift. e.g. 2 shift asset will start at 7:00AM finish at 11:00PM
or 3 shifts asset will start at 7:00AM finish at 6:59AM

Now I have 82 assets in the factory and 20% of those machines run 3 shifts. Each shift is 8 hrs.

What I have already done is allocate shifts per asset e.g.

when I pick Asset (a) in the Asset combo box, in the shift box it will automatically generate 2 or 3 dependant on what I have set.

If an asset runs for 2 shifts, it would mean that, that asset is operational/running from 0700 - 2300 or 7:00am - 11:PM

also if an asset runs for 3 shifts it would mean that, that asset is operational/running from 0700 - 0700 or 7:00AM - 7:00AM

These are the scenarios that is entered through a "Form"

Scenario A: Machine (a) breaks down at 1700/5:00PM on the 10/7/15 and was back online at 12:30 on 11/7/15, This machine runs for 3 shifts which would mean in the "Breakdown Downtime" the result should be 19.5 hrs

Scenario B: Machine (b) breaks down at 1900/7:00PM on the 10/7/15 and was back online at 10:00AM on 12/7/15, this machine runs for 2 shifts which would mean in the "Breakdown Downtime" the result would be 23 hrs.

I would like to make this an automatic calculation, Is this possible?

Please note I am not after a "Query", I need this calculation in the main Database table named "Tbl_MaintenanceDATA".

I understand this is not the norm and many have suggested against this, however for the purpose of what I need, it needs to be in the main table with all the other data.

Here are some snip it
snipit2.png
snipit.png

View 5 Replies View Related

Reports :: Calculating Sum (count) And Percentage Field

Jun 16, 2013

I am trying to work out the expression that will first count the number of 'Yes' returns in a series of yes/no boxes and then display as a percentage.

To explain...The yes/no boxes represent attendance over a 20 lesson course. I have added a count for each lesson for student attendance..(grouping them in the footer) but I would like to add the number of attendance for each student.

View 1 Replies View Related

Queries :: Calculating Specific Value In Multi Valued Field?

Dec 31, 2014

have a look on the attached sample database.

How can I get the query to work in order to count specific values per day.

View 5 Replies View Related

Calculating Numeric Value Of A Field - After Insert Macro Not Functioning

Jul 25, 2012

I'm trying to calculate a numeric value of a field based on the value of another field as a row is created using an "After Insert" macro. To test this I've created a table which has two integer columns "NUMBER1" and "NUMBER2". The macro was defined using the wizard as:

Code:
EditRecord
SetField
Alias
Name NUMBER2
Value = 5+[NUMBER1]
End EditRecord
NUMBER2 is not populated when I enter a value in NUMBER1

I get the following in USysApplicationLog:

Error Description
-20335 EditRecord failed because the default alias represents a record which is read only.

View 2 Replies View Related

Calculating Using Forms...can It Be Changed?

Jan 2, 2006

If in a form i have a box that calculates something i cant change that..is there a way around it?

for example on a sales invoice consider the following fields..

sales total

sales tax

grand total

grand total=sales total + sales tax...

but what if i want to change it?? not the formula.. but just to overright it?

View 1 Replies View Related

Queries :: Calculating Bonus - Expression Using Sum Of Another Calculated Field In Query

Mar 28, 2015

I've can do this on excel but don't know how in Access. I'm calculating bonuses. My table has salaries, and my query simply multiples each salary amount by a % to get the bonus amount. But I need to calculate adjustments to the bonuses using the sum total of the bonuses my query calculated:

Salary (from table) Bonus (calc'd by query) Adjustment (to be calced)

100,000 1,000 Sum of total bonuses/salary*4%
90,000 900

How do I capture the total of my calculated bonus column to use to calculate the adjustments in my right-most column?

View 13 Replies View Related

Modules & VBA :: Calculating Information For A Text Field On A Form From A Query

Aug 4, 2014

I have a data entry form [Resources] and I would like to display some information about holidays in the form footer. Once the user has picked a combination of Trainer_Name and Start_Date I would like the 'On Change' or 'On lost Focus' event (not sure which would be the best) to perform a datediff calculation.

The datediff calculation would compare the difference between the start date entered on the form and the most recent past Start_Date on a query called [Hours Holiday_P1].I could adapt the same code to also look for the difference between the End_Date on the form and the next Start_Date on the Query.The idea is that when resourcing trainers I know how long it is since and how long it is till their next holiday.The sql for the query is

Code:
SELECT Resourcing.Start_Date, Resourcing.Trainer_Name, Resourcing.Duration, Time.Hours, [Hours]/7.4 AS Days
FROM (Resourcing INNER JOIN Employees ON Resourcing.Trainer_Name = Employees.Trainer_Name) INNER JOIN [Time] ON Resourcing.Duration = Time.Time
WHERE (((Resourcing.Start_Date) Between DateSerial(Year(Date())-IIf(Month(Date())<4,1,0),4,1) And DateSerial(Year(Date())+IIf(Month(Date())>3,1,0),3,31)) AND ((Resourcing.Activity) Like "Holiday*"))
ORDER BY Resourcing.Start_Date;

View 14 Replies View Related

Calculating Field Specific Averages From Records In Separate Tables

Apr 28, 2014

Let's say I have a table sort of like this one: [URL] .... (Table 1)

What I want to do is make another table that references the first table: [URL] ... (Table 2)

I want the cells in the Average field in Table 2 to calculate an average of all the values for records in Table 1 with Color fields that correspond to the Color field in Table 2 (this makes a little more sense if you look at the pictures). I could do this in Excel, but then problems would arise whenever I would add a new entry to the database, or re-alphabetized the data, since Excel math is depends entirely on the positions of cells, and I want these averages to be continually calculated correctly and to change whenever I add related records to the database.

View 1 Replies View Related

Forms :: Calculating Time Accurately?

Nov 3, 2014

i have a opened date[default value =Now()]
and
resolved date[default value =Now()].

i would like to calculate the time elapsed between the two dates. it is normally on the same day, but there are instances where it can run past midnight.

View 12 Replies View Related

Forms :: Calculating Time Into Cash Value

Nov 11, 2014

I have a combo box which looks up a set of values from a table, some of these I have got to store, others I merely want to work with and calculate from. These columns are:

DutyNumber
WeekendOrBHPayment
Sun-ThursNightsPayment
FriSatBHNightsPayment
OTRate
WRDRate
AHDifference
SKPayment
UnSocPayment

Now for most of these, I 'think' I have it planned where they will go or how they will be used, but the OTRate is flummoxing me a wee bit.

On the form, I have an OT(time) field - the idea being that the user will enter the hours and minutes of overtime they have done (short time format - is this correct?)

Then, I would like the form to calculate the cash value (has to be stored in a field) by multiplying the hours/mins worked by the OT Rate - - but I don't want to store the OTRate unless I really have no other option. Once the calculation has been done, if the Rate is then 'forgotten' then that is no issue, as the only time it would be needed is if the field is revisited to amend any errors (so I am thinking the calculation should be done as an After Update event on the OT(time) field?)

View 14 Replies View Related

Calculating Account Revenue For Sales Reps - Group On Totals Field

Jul 9, 2013

I have a report that is calculating account revenue for my sales reps. I am able to generate the report, group by the sales rep and then total their total account revenue. Now I want to group on the total field that I just calculated. How do I do that?

View 14 Replies View Related

Forms :: Calculating From A Query Based Subform

Oct 9, 2013

On my master form I have a subform called invoices this is tied by Site Number to the record on the form which is has the following important information, site code. group code, exp code an amount.

On another subform via a query I have a summary of all the invoices by exp code and group code.On another subform I need to create a Income an Exp.

I have two combo boxes 1 for the Group Code, and another for the expense code what I want it to now do is look up group code exp code = Total amount. There is currently only 1 line as you will see but there will be many rows of summary data...do i need a subform for the summary?

And I need to do it this way as not all exp appears on the income and exp and I want to be able to lay out the expenses for each site differently Attached is the zip file, of the database the only record that has data is site code 0289S

View 2 Replies View Related

Forms :: Calculating Months In Search Form?

Sep 25, 2014

I tried to create search Form in access and after trying for while I finally made it. I have drug down the "query" to the design view of "Form Search" and added up there. Now using "STD" and "TELENO" I can search for these 3 coloumns. My main table is "Example"

Now as you can see in my attached screen shot Column "Recieved Time- less than 3 month" I would like to do that in Access. I would like to create something that will autometically calculte(Substract) the date from "Order Date to Today's date and will give me a result= "Less than 3 months or Greater or less than 4 months etc". I mean it will always substract from "Order Date" to "Todays Date". I have tried with some macro as well but it did not show up "Todays date"

I tried several ways to do it, even tried to input another coloumn(Using formula) in "Query" table but failed to do so.

View 2 Replies View Related

Forms :: Calculating Fields And Auto Update

Jun 15, 2013

In this table I have two fields Seats Available and Seats Remaining

When I register a student to a Course in the Courses table I would like the corresponding Seats Remaining field for that course to decrease automatically.

I can, of course, run a report or a query to see how many are enrolled in the course and then manually update the Seats Remaining field (which is what I currently do), but I would like this process to be automated each time I register a new student.

View 4 Replies View Related

Forms :: Calculating A Future Business / Work Date

Sep 14, 2013

I am trying to find a simple way to determine the work date based on knowing the Start date and how many days ahead I want the date for. These means I need to exclude weekends and holidays.

I tried Pat Hartmans solution located at

[URL]

I discovered that the function in there that is supposed to do this does not account for weekends, only holidays.

View 7 Replies View Related

Forms :: Attendance Tracking And Fees Calculating For Gym Database

Apr 11, 2013

I'm creating a Gym Database and need to be able to track attendance for specific classes. I need to have a system in place allowing me to do a register for attendance for each activity.

I also need to be able to calculate fees based on attendance. So if a person attended Gym 5 times in the month (£5 per session) and then Swimming 3 times in the month (£2 per session). My system should automatically calculate this based on the attendance tracking.

Also: In the booking stage, I need to have a field telling me how many spaces are left on each activity. Say for example I'm booking Person 99 in for Swimming and there is only 11 places left I need the field to display 11 places left. After that booking it should update saying 10 places left because Person 99 is booked in.

View 1 Replies View Related

Forms :: Current Time On Form Status Bar - Keeps Showing Calculating

Aug 2, 2014

I have my main menu form that shows the current time and uses the OnTimerEvent for this. (Set to 1000) Issue is that when I open another form it keeps showing Calculating. It does not seem to affect performance but keeps the status bar from showing the control explanations.

View 10 Replies View Related

Forms :: Calculating Working Days Based On Date Range

Mar 20, 2014

I am trying to calculate the working days Based on all web searches I am unable to find the specific scenario I am working in Auto industry, which means auto industry usually close twice a year for any reasons, let say in July for one or sometime two weeks and in December depends upon the Christmas date usually from December 20 till Jan 01

Now my question is when i am enter the holiday details in table do I have to enter line by line date e.g. july 01, 02, 03 (I am able to understand, how this works but still not yet tried) OR july 01 to July 07 (which make sense, but unable to find how to use date range to calculate working days)...

View 1 Replies View Related

Forms :: Copy Value From Field In Subform To Field In Main Form During Data Entry

Jul 18, 2013

How can I get the value from a field in one table (in the sub form) to copy/insert into a field in another table (in the main form) when adding a new record?The main form and sub form are linked using parent/child linking, and the sub form is in a tab.I have table A (Visit Dates) in the main form which is used to record the date of a visit to a church. Table B (Quarters and Peals) is used to record an event that took place at that church during that visit. Note that not all visits in table A require a record to be created in table B - but half or more do.

In tables A and B I have a field called "QuarterOrPealID" and these are both primary keys, though the field in table B is set to 'no duplicates' and in table A it's set to 'duplicates allowed', as table A has its own auto number/pk. They are both linked in the relationships.

So, when I add a new record to table A using the main form, I might then need to click on the tab in the sub form to create a new record in table B, which has to be linked to the same record in table A. When the "QuarterOrPealID" auto number/pk is generated in the sub form (table B), I need that value to update to the "QuarterOrPealID" field of the main form (table A), so that when I'm viewing these records the form pulls all the information nicely together.

View 10 Replies View Related

Forms :: Can A Field Auto-fill From Previous Entry In Separate Field

Mar 21, 2013

I've just returned to work after kids and started managing a large Access database related to health, back-tracking over many years.

Currently in filling a form we physically enter:
Apples 2.2
red apple 2.4
red apple cut 2.45
Oranges 5.6
Cucumbers 8.5

Is it possible to get field 2 to automatically fill with a number code due to the text typed in field 1?

FWIW, I'm confident at more basic Access e.g making follow on default value = Dlast("field""table") type stuff but the more complex stuff I haven't touched since Uni over a decade ago and you will need to be gentle while I blow away the cobwebs

View 3 Replies View Related

Forms :: Move Focus From Last Field Of Subform To Another Field On Main Form

Aug 19, 2015

I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.

Customers(mfrm)....>Addresses(sfrm)...>Orders(sfrm Add)......>OrdDetails(sfrmOrders)

Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved