Calculations With Values In Forms & Subforms

Jan 21, 2005

Hi Everyone! Bear with me, I'm new to Access and I may not understand or use all the terminology correctly.

Background: I'm creating a database to track the inspections of many businesses. Each business will have many inspections throughout the year and each inspection has many items. I have a form set up which includes Business info and Inspection info (#items inspected, subtotal for inspection) on the main form, and Items in error listed on a subform (no error=no items listed).

Problem 1: I need to make a count of all items that are listed. I can do this in the subform, with no problem (in one of the footers #Discrep:count([item])) but now I need to report and use that value on the main form to calculate the percent error for the entire inspection. I don't know how to pull in onto the main form to set up my calculation. :confused:

Problem 2: This one is related and is probably the same fix. I have PriceCharged and PostedPrice for each item. I need to calculate the net error and then, using the subtotal on the main form, calculate the % dollar error.

Any suggestions, oh great and powerful gurus of the Access world? I hope I explained that clearly enough for you.
Thank you very much in advance!
~Lith

View Replies


ADVERTISEMENT

Form And Two Subforms Calculations

Feb 5, 2006

I have a problem with main form and two subforms in it. Both subforms are in "continuos" mode, and each of them has field in footer, where it calculates total sum for all field that are in it.

Then there is main sum below both subforms (all this is in detail section of form) and it calculates total for both sums of each subform.

Whenever i fill values in first subform and in second subform, i have results everywhere, but if i fill values in first subform but leave second subform empty, the "main sum" below both subforms is empty also....

The control source for main sum field is "=Forms!frmMainForm!frmSubform1!Text1 + Forms!frmMainForm!frmSubform2!Text2" where Text1 is "total sum" in first subform and Text2 is "total sum" in second subform...


I set default value = 0 for all fields in both subforms, but it won't help....still shows empty fields in that subform, which isn't filled....Actually when i open form for the first time, it shows "0" values in all empty fields and then immediately clears them and shows empty fields...

Any ideas how i could solve it?

Thanks

View 1 Replies View Related

Zero And Nul Values In Calculations

Nov 6, 2006

Help!

I have a database that records all procurements and requisitions of our medical supplies.

I have set up queries that sum all requisitions in a set time frame for each item that should be in the store (i.e. this month, this year etc) and similar query for the procurements.

A further query then subtracts the requisitions from the procurements and (should) give me an inventory of all medical supplies.

BUT.....

If no items have been procured or requisitioned, they are excluded from the sums. We have a standard list of items (which is a table in the DBase) and I need to know if we have no stock (there are certain things we can't get all the time in Tanzania, so procurements and requisitions are zero/nul for a while and I need the Dbase to highlight the lack of items).

Please help!

Note, if there is away of doing this with out VB I would be very happy as I have never used VB and it terrifies me.

Matt

View 3 Replies View Related

Calculations On Selected Values From One Field

Oct 24, 2007

I have a table with the following logical structure:


Name...Number eaten of apples......Number of eaten oranges.....All fruits

Mike...............3.............................. ..........4...........................7
John...............5.............................. ..........3...........................8
Peter..............2.............................. ..........2...........................4
Phil.................1............................ ............4...........................5

Question 1:
Can I calculate in a query sum totals for apples (or oranges or all fruits)
eaten by Mike and Peter together and ignore John and Phil?

Question 2:
How can I get sum totals for everybody excluding just Peter? Or Peter and Phil?

Your help will be very much appreciated!

Aleksandr

View 3 Replies View Related

Queries :: Run To Extract Some Values For Calculations

May 12, 2015

I have a query that I run to extract some values for calculations. Its run on an event based on a dropdown selection. At the moment, I run via:

Code:
DoCmd.OpenQuery "CallMidprice"

and then close it. this seems to take more time than is necessary when I only want to refresh the results.Open query without close, switches to the table but doesn't update until I press F5.When I try requery I get an error. "Runtime error '2109': There is no field named 'CallMidprice' in the current record.

Requery without 'Callprice' seems to requery my form.

View 5 Replies View Related

Queries :: Calculations With Values In Previous Record(s)

Jan 12, 2015

I have a database where I need to record student data, specifically marks and absenteeism. The marks are recorded each term as a running total. I have a final mark which needs to be equal to the 4th term mark.

I also need to record the number of days absent each term with a total at the end of the year.

My problem is that the term 4 mark is a in the previous record and the total days absent needs to be the total of the previous 4 records (term 1 - 4).

I using a create table query and an update query but that was a no go.

View 7 Replies View Related

Grabbing Time Values From Table In Visual Basic And Performing Calculations With Them

Nov 8, 2004

Hi,

My boss wants me to program in visual basic, instead of using queries, a calculation between times, which values are gotten from a table. How do I perform a calculation between two fields from a table in code and what functions are there to calculate the amount of difference in minutes between times in visual basic? THANK YOU SO MUCH IN ADVANCE!

G

View 3 Replies View Related

Retrieving Values From 2 Subforms

Jul 10, 2006

Hi,
I making a query which creates a list of customers in a month. For the start and end dates of the month, they are retrieved from a table and put into 2 seperate subforms. The query isn't working through, so I was wondering if anyone would see where I'm doing wrong.

In the order_date field in the query, I have this as the criteria:
Between [Forms]![sub_fltStart]![DateList_Start] And [Forms]![sub_fltEnd]![DateList_End]

If you want any more clarification then just ask :)

Cheers,
Ben

EDIT: spelling/grammer

View 2 Replies View Related

Compare Values Between Two Subforms

Jul 16, 2007

Any idea if there's a way to compare values between two subforms on one main form?

I have a Required Inventory and and an Actual Inventory subform. I want the Actual Inventory field to be conditionally formatted to turn red if it is less than the corresponding required field and green if it is more. I know how to use Conditional Formatting, but I don't know how to reference the values in the next form.

Note: I have no problem using conditional formatting compared to values in the parent form. The syntax I used for that was:

[Forms]![frmMain]![txtControl]

But still no luck referencing subform controls.

Thanks.

View 1 Replies View Related

How To Add Values From Multiple Subforms

Jun 20, 2012

how to add times together from multiple subforms and display the data on the main form. Just for backround, I am creating a timesheet to be used by our workshop employees. The form is set up in such a way that there is a combo box where they can select their name which rotates the record so all the data is specific to their id, and then there is a tab box with a tab for each day of the week each containing its own subform with combo boxes to select the project they worked on, text boxes to enter the start time and stop time for that project, and then 2 other text boxes: one that calculates time worked on that particular project and then one that calculates the total time worked for the day since they typically work on more than one project in a day. So what I need to do is to take the values from the total daily hours boxes and add them all together and show the sum in a box showing the total hours worked for the week.

My most recent attempt was to simply make an expression in the control source as follows:

=[Sunday subform].[Form]![Daily Hours]+[Monday subform].[Form]![Daily Hours]+[Tuesday subform].[Form]![Daily Hours]+[Wednesday subform].[Form]![Daily Hours]+[Thursday subform].[Form]![Daily Hours]+[Friday subform].[Form]![Daily Hours]+[Saturday subform].[Form]![Daily Hours]

View 2 Replies View Related

Calculations On Main Form Do Not Reflect Calculations On Subform

Sep 28, 2015

I have solved the problems getting values on the subform. I have not in getting values on the subform.For instance, on the one titled phone use the formula in the tutorial is:

=[sbfCustomerRoomUse].[Form]![txtTotalPhoneUse]

#Error results when the doc is put into a form mode.

Now when I input each value in the equation above separately.I still get no entry.

For " = sbfCustomerRoomUse" , I get #Error;
and for "= txtTotalPhoneUse", I get #Name.

CustomerRoomUse and txtTotalPhoneuse are from the subform that was dropped into the customer form in a previous step. It shows that explicitly when designed sbfCustomerRoomUse on the main that CustomerRoomUse come from a subform. This does not seem to need to be done with txtTotalPhoneuse, and I am not sure why. Neither one gives me a desired calculation result.

View 14 Replies View Related

Calculations In Forms...

Apr 7, 2006

Hi Everyone:

I have a question that I can't seem to figure out. I am trying to create a form in which there are three major fields. 1) Value 1 2) Value 3) Sum of Value 1 & 2. I want it so that two fields are added up and then the sum, which will populate in the third field, will be stored in a table.

Does anyone have any suggestions on what I can do? I am fairly new to access and haven't had much luck finding anything on the net.

I appreciate any and all advice.

Thanks!
Darin

View 9 Replies View Related

Secondary Forms And Calculations, Pls Help

Oct 11, 2004

Hello

I have this problem. I've made a table called "producers" and a main form based on this table. I've also made a table called "orders", with several data regarding orders, and a secondary table based on the "orders" table. These tables are linked. So these forms show the orders made by each producers. Now , I try to add the "price" field of each record of the secondary form and then show the result in a text box in the main form, so that I can have a total price amound for each producer.I've tried many things but nothing seems to work. Is this so difficult to achieve? Pls help. Thank you in advance!

View 14 Replies View Related

Forms :: Calculations In A Form

Jun 27, 2013

performing calculations in a form in an Access 2007 database.The form is used to generate invoices and sales receipts. At the bottom of the form there are 3 text boxes: "Sub-total" (Text128), "VAT" (Text130) and "Total" (Text132). Each text box is bound to the Control Sources "Sub-Total", "VAT" and "Total" respectively in a table called "Orders".

I would like the "VAT" text box to automatically calculate the VAT on an order and enter it into the VAT field in the table "Orders". To do this I have tried using the formula:

Code:
=[Text128]*0.2

I would also like the "Total" text box to automatically calculate the total cost of the order and enter it into the Total field in the table "Orders". To do this I have tried using the formula:

Code:
=[Text128]+[Text130]

I know that these calculations are correct as they work in an unbound text box however I cannot get this to work with bound text boxes.Is it actually possible to do this or do I need to use another method to perform these calculations?

View 13 Replies View Related

Forms :: Calculations Not Entered Into Table

Mar 18, 2013

I created a Form to enter data into a table. Two fields are numeric and typed into, a third field calculates the ratio instantly. I did that by entering "=field1/field2" into the control box in the properties panel for that form element.

However, when I look at the table, all the data goes in except this calculated ratio. Is there a way to get the form to "write" it to the table?

Alternatively, how to get the table to act like a spreadsheet and automagically calculate that third column, then it actually doesn't even need to appear on the form.

View 5 Replies View Related

Forms :: Form Calculations With Errors

Jun 11, 2013

I am currently working on a form that calculates the sum of counts and charges for various categories. The form sums the number of items in each category, then the sum of the charges. Where I am stuck is trying to break out the "per unit" charge for each category. The calculation works fine (sum of charges/sum of items) when there is a number greater than 0, but if the count or charges are 0, the fields display errors. I attempted to compensate for this by setting the text box value on the form to iif(iserror(sum of charges/sum of items),0,(sum of charges/sum of items), but it still shows the error!. I could probably write nested iif statements to evaluate the values of each sum, but you would think this would be simpler. Here is a sample of the actual ControlSource field on one of the text boxes:

=IIf(IsError([SumOfOracle_Qual_Dev_Charge]/[SumOfBaseline Qualified Developer]),0,[SumOfOracle_Qual_Dev_Charge]/[SumOfBaseline Qualified Developer])

View 2 Replies View Related

Calculations And Tests In Data Entry Forms

Feb 22, 2005

Hi all,

I have a data entry form with several values that could be calculated and entered if I knew how. The FAA requires logging and tracking values that result in the following fields:
TimeSEL
TimeXC
TimeNight
TimeDay
TimeDual
TimePIC
TimeTotalFlight

My last flight resulted in entering 3.4, 3.4, 0, 3.4, 0, 3.4, 3.4

My question is: is it possible to add some sort of test expression in the TimeXC field which would examine an associated check box (i.e. "Was flight XC?") and if it was checked then would automatically calculate the flight hours (TachStop-TachStart) and enter the value in the TimeXC field?

Thanks for any help.

View 2 Replies View Related

Forms :: Dashboard - Calculations On Invisible Form

Apr 3, 2013

I have a dashboard that opens with my main form and it contains many textboxes with Dcounts, Dlookups and Dsums in it. I am hoping that I can put these textboxes on a separate form that is hidden unless a command button is clicked to make it visible.

I know how to do this, but my question is whether or not all of those queries will run whether or not the form is visible. Obviously if the Dsums etc.. are going to run anyway, then I won't bother.

Is there a better way to do this?

View 1 Replies View Related

Forms :: Textbox That Get Value Both From Calculations And User Input?

Nov 7, 2014

I have a form bound to a table, with a subform in there, and I have a textbox with a source one of the table's fields. I would like the value of this textbox to be calculated based on the values of some boxes in the subform, but I also wont to be able to edit the value on the textbox myself.

Is it possible to have a textbox that get its value both from calucaltions and user input?

View 1 Replies View Related

Forms :: Perform Calculations After Text Boxes Updated

Mar 14, 2013

I have a subform based on a query. That query contains a couple of calculations that end up in textboxes on the subform. The problem is that the calculations require me to enter 2 dates that are on the subform. If these are not entered before the calculation is performed I get a "Cannot update record" error message and then #error in both Lease cost and Discount Cost textboxes.

View 6 Replies View Related

Forms :: Form Calculated Control Using Calculations From A Query

Dec 18, 2014

All I'm after is, to sum in all records "where" reconcileDate (on the sub=form) = today in both the credit and debit fields and minus one from the other. I have a simple form and sub-form. On the sub-form I have a query based calculation that returns the following..."if ReconcileDate (on sub-form) = today, then show Debit value in yndebit" textbox..Likewise with the credit box, and all works perfectly fine.

However, I can't seem to sum these two boxes. Because the circled textboxes are query based, I've used the query as the control source (and not the text boxes) and all I get is an #ERROR? when placed in the form footer. I've tried to do this using the textboxes as the control source, and still nothing. I've tried to add a calculated control on the form itself, and still #ERROR? or #NAME? despite knowing exactly how to reference subforms within forms (this I've become quite an expert at as I simply use query design to make sure I have the correct path and control)anyway.

View 13 Replies View Related

Forms :: Calculations In Subform - Display Total Amount For All Records

Nov 20, 2014

I am trying to get the main form to display a total Amount for all records in Purchase order details but the control displays Error:

I have a Form called frmPurchaseOrder with a sub-form sbfrmPurchaseOrderDetails

sbfrmPurchaseOrderDetails takes item details from a table based on what is selected in the combo box then fills out four additional fields in the same sub-form.

SELECT tblItemListDetails.ItemID, tblItemListDetails.ItemName, tblItemListDetails.ItemSize, tblItemListDetails.ItemUnit, tblItemListDetails.ItemUnitCost, tblItemListDetails.ItemBrand FROM tblItemListDetails WHERE (((tblItemListDetails.Supplier)=[Forms]![frmPurchaseOrders]![SupplierCombo]));

Private Sub cmbItemName_Change()
Me.txtSize.Value = Me.cmbItemName.Column(2)

[Code] ....

View 5 Replies View Related

Forms :: How To Find What Data Is Actually Being Passed Between Forms And Subforms

Nov 22, 2013

I have several Suppliers, each of whom holds several SalesEvents. At each SalesEvent I might buy none, one or more Bundles. Each Bundle then contains one or more Items. These relationships are all reflected in my Access 2013 desktop db as one-many relationships with cascaded updates.

My form structure for data entry reflects the Relationships, in that I have a Supplier form with a SalesEvents subform. On that subform I can enter data about each of that Supplier's SalesEvents, and each SalesEvent row has a button to call up a SalesEvent form which has a Bundles subform. Then each row of that subform has a button which calls up a Bundle form containing an Items subform. That Bundle form identifies the Supplier, Sales Event and Bundle number, and within its Items subform I can then enter the data for each Item.

Problem : All used to work fine, but I've clearly changed something because now when I select the Items button on the Items subform in the Bundle form, the system gives me the data for the first record in the SalesEvents table, rather than the one selected. I have checked the raw data and that's as it should be. I have tried to undo all the steps I took since it last worked properly, but to no avail. Restoring the last backup (taken when I'm sure it worked properly) still has the problem.how do I find what data is actually being passed between forms and subforms ?

View 3 Replies View Related

How To Link Subforms To Other Subforms On An Unbound Form

Feb 4, 2006

I forum could someone tell me:

I have an unbound form on that form I want to put three sub forms one on a products table the other on a course start dates table and the link table that joins the other two together. all three are related to each other with Pk/FK links.

When I try to link them it says you cannot link items on an unbound form.

regards in advance
Peter:eek:

View 1 Replies View Related

Forms :: Forms With SubForms Opening With New Record?

Mar 8, 2013

I have a main form with multiple subforms in tab view, right now the forms only open in edit mode, I would like all forms to open to new record mode. I know I can set the main form with the switchboard manager but what about the subforms?

View 2 Replies View Related

Forms And Subforms

Jul 2, 2007

I am attempting to create a database for my users to input new data via a main form. I have this main form where I use subforms as look up tables/queries to pull my stored data from. My problem is that I want to try and not have the subform on the main form; I want it to be its own window. Bear in mind I am new to using Microsoft access, and trying to learn as I go.

I have created all the forms with queries. I use the open form command to get me to my subform, which is a common findings form. From there I am able to search and filter, and once I find my desired record I want to be able to link certain fields back to the main form. (basically if possible use a command button to select this information and insert it on the main form). Typically, my users will have a generic finding to to record so I have inputted these findings so that they can select them and not have to type them themselves. Is this even possible for me to do this way, with a command button by writing a VBA code and linking criteria? The reason I am creating a separate form is so that the main form is not cluttered and is user friendly.

The fields I want to link are the same, however they are not from the same queries, and essentially the main form has its own since as of right now there is not data because it’s run of user input. The findings form has data. There are relationships established.

Thanks for any help, I feel like this might be confusing since I am unsure of exactly what I am trying to do, but any help would be greatly appreciated.

View 3 Replies View Related







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