Immediately Updating Totals Calculated From Subform/query

Aug 6, 2005

I have a problem with a total on my main form (calculated from a subform) not updating immediately. The updated total only displays correctly after I’ve navigated to another record and then back again. I would like the totals to update immediately after I’ve entered the new data. Can anyone help? Here are the specifics…

My main form has a subform which displays a dynaset of records from a query. I’ve set up this subform so that I can enter a new record, which is then written back to the record source for the query. This is accomplished via a combo box from which the user selects a product, and an AfterUpdate event returns the price of that product to the TotalPrice control on the subform. In the footer of this subform is a calculated control (called AdExpenseSubTotal), which calculates the sum of the TotalPrice field from the query. The footer of this form is hidden, and I’ve set up a control on the main (TotalSpent) form which displays the value of the subform control AdExpenseSubTotal. This total seems to update immediately whenever I tab off the relevant field in the subform – so far so good, no problems here.

Now here’s where it gets tricky. My main form has another subform which is hidden. This subform returns a dynaset of records from another query which has the same record source as the query on the first subform. Like the first subform, this subform also has a hidden calculated control with an aggregate function (Sum), and a calculated control (VendorSpent) on the main form to display its value.

As I said before, when a enter a new record in the first (displayed) subform (via the combo box) and tab off it, the TotalSpent control on the main form updates immediately, but the VendorSpent control doesn’t. Obviously the new record I’ve added doesn’t immediately show up in the query dynaset of the second (hidden) subform from which the VendorSpent control on the main form gets its value. The VendorSpent control only displays the updated total when I navigate to the next record, and then navigate back again.

Is there some Event Procedure I need to add to the AfterUpdate property of the combo box on the first subform which immediately forces the second (hidden) subform to requery? I probably haven’t explained myself very clearly, but I can provide a copy of the file (it’s only 184 Kb) if that helps.

View Replies


ADVERTISEMENT

General :: Show Query Result In Form Textbox Immediately After Updating A Record

Nov 24, 2014

I am building a Inventory Management Application for Tyre Shop. I have SaleMainTbl and SaleDetailTbl both used for preparing daily sale summary. I have Mainform based on SaleMainTbl with TxnDate and Total Amount (Sale) and the TxnDate is in one to many relation with SaleDetailTbl. FormSaleDetail is multiple row(continuous) form that makes billwise summary of each day having -TxnDate--BillNo--ItemSold--Company--Qunatity--Rate--Amount fields. I have inserted this form in FormSaleMainTbl.

So FormSaleMainTbl is Main form and FormSaleDetail is subform. TxnDate in FormSaleDetailTbl is automatically taken from SaleMainForm. I have further added text boxes in Main Form to show company wise sale for each day for which there is a query build one for each company that takes the currently loaded date from FormSaleDetail and calculates the Sale (Sum) of each brand (Company) of Tyres. All these objects are working very fine. However I have to close the MainForm and reopen it for result of query to appear in the appropriate text box in Main form.

Is there way to do this as soon as record is entered or at least at the end of completing the entry of each days sale transactions without closing the form. So the gist of the problem is realtime display of query result in text box on a form or updating the form screen immediately on updating any record or at the most after completing the updating of form but without having to close the form.

View 5 Replies View Related

Queries :: Sum Calculated Query Without GroupBy Totals?

Jul 11, 2013

Im trying to run the following calculated query:

Total Value on order: Sum([Purchase Price])

I want to sum the total of all the purchase prices together so I know the total value on order. I keep getting an error: "You tried to execute a query that does not include the specified expression Purchase Order' as part of an aggregate function

View 2 Replies View Related

Totals Of Calculated Fields In Report Footer

Dec 10, 2014

I have a Report that has calculated fields in the details section. I want to total those fields in the Report Footer. When I run the report I am prompted to enter the value for the calculated fields and the Totals do not appear. Access must be inspecting the report before it actually runs. And so, since the calculated fields do not exist until the report is run then Access doesnt find them during the inspection and hence prompts for input.

View 2 Replies View Related

Reports :: Hourly Rate - Calculated Totals Not Adding Up

Sep 5, 2013

We recently have had a change to our hourly rate that we pay and now the Totals calculation is not adding up the numbers correctly.

In the query that the report is based from:

ExtendedTotal: CCur([Hours]*[Rate])

In the footer of the report: (Provides a Total for each Day)

Sub-Total: "Control Source" is: =Sum(CCur([ExtendedTotal]))

Report Footer: (Provides a Grand Total for the Month)
Total: "Control Source" is: =Sum([ExtendedTotal])

Problem comes in with the odd dollar rate time partial hours. For example:

$9.73 x 4.5 hours = $43.785 (Rounds to $43.79) which is fine...

but when you have a whole column of these rounded numbers, the totals are coming out off by pennies which add up to a good bit at the end of the month. I cannot match up the totals with the invoices that are coming in either.

View 14 Replies View Related

Totals Query/sums/grand Totals

Sep 4, 2007

Hey all! This is my first post. Been searching through the net all day trying to find a solution to this problem. Basically i have a table that looks like this (regular text is what i have and bolded text is what I need:Name Date Qty MOBrad 12/12/2007 23323 4423John 12/11/2007 3445 4432 John 12/11/2007 344 4432 John 12/11/2007 45 4432 John 12/11/2007 44 4432 John 12/11/2007 3445 4432 Grand Total: (Qty)And then I'd like to be able to carry this over and display a grand total at the bottom of every page of a report that I would need to generate. Our company produces forms and we sometimes have 60 - 70 people working on a single job. We want to see their hours individually but we would also like to see a grand sum of all their hours. If someone could help with this or needs more info let me know. Thanks for all your help!

View 14 Replies View Related

Forms :: Updating Subform With Query Results

Feb 21, 2014

I have a basic DB for recording supplier records, you enter a supplier ID and it performs Dlookups to run and display query results on the same form. That part works fine.

I've added a subform and linked it to an existing query which returns the suppliers top selling lines and the query picks up the supplier from the ID field on the main form, however when I enter a new id the subform doesn't update with the results specific to that supplier.

So I think I need a way of getting the subform to re-run the query each time I update the supplier ID field, but I can't see an option for this in the subform properties.

View 2 Replies View Related

Forms :: Calculated Fields Not Updating Automatically

Apr 17, 2015

I'm still very new to Access.I have a form with subforms.Some of the fields are calculated fields.I cannot figure out what some of the fields will not update automatcally. Once I click out of the form and then back in, it will update.Tried many things like, Refresh, Requery both on the form and on the text box(es).I wish I could figure out how to attach my test database to show you.

View 11 Replies View Related

Forms :: Updating Calculated Dates From A Form To A Table

Mar 19, 2013

I have a table which is used to store info regarding medicines dispensed. I also have a corresponding Form to enter data. The fields in Table are

ID- number
Dispensed Date- date with dd/mm/yyyy format
Dispensed Type- text
Quantity- no. of days
Next Collection Date- date with dd/mm/yyyy format

The Form also contains same fields but it has a calculated field for ( Next Collection Date) where i calculate date using Dateadd function. Also the form has a Datasheet view. So records are added when I press Tab or Enter at last field.

Now the problem is the calculated dates arent getting updated in the table. And this is a huge problem as i have to run a query later where i will put a criteria on Next Collection Date.

View 3 Replies View Related

Forms :: Updating Table With Calculated Field On A Form?

Apr 13, 2013

A textbox on a form concatenates 2 strings. I want to insert that resulting string into a table .how can i do that ?

View 1 Replies View Related

Help With Totals In SubForm Pls.

Sep 12, 2005

folks,
I have two simple tables in a database. One Table is the entry table and the other is the totals. I then created a Form and a subform from the two tables. What I would like is to maintain running totals in the subform as entries are made in the entry table. Attached is the Database. Please help.

View 2 Replies View Related

Pulling Totals From A Subform

Jun 22, 2006

I've got a form for a volunteer tracking database I am trying to create that has all the voluneer's infomation and has a subform in it that shows the volunteer's activies and hours. I have a text box (txtHours) on the subform with the following Control Source "=Sum([hours])", with the visible property set to no. This sums the total hours volunteered by the individual.

On the main form I have another text box (txtTotal) with the following control source "=Hours.Form!txtHours" where:
Hours is the Name of the subform and the Form!txtHours references the control on the subform.

I am trying to create another textbox that will display the total hours for all records in the form, but not having any success.
Any suggestions?

View 4 Replies View Related

Calculating Totals For A Subform

Feb 22, 2006

I have created a form with company ID, company name, and so on. I put a subform in the main form which includes invoice & points information. Somehow I need to calculate a balance for each customers points. In the form I have points earned and points redeemed...how would i get the totals for each customer's balance?

The main form is linked to the subform, so that you can see each individuals record of points. Please let me know how I can get the balance for each customer.

Thanks.

View 1 Replies View Related

Forms :: Automatically Updating Fields In A Subform From Another Subform

Feb 11, 2014

I am having trouble figuring out the method to automatically update some fields in SubForm from 2 other SubForms.I have attached 2 pics, the first GradeEntry1 shows what the tblTopic_Class_Grade form looks like after I manually enter everything into it. GradeEntry2 is what the form looks like when I fill out the Form starting at the top.

I'd like the tblTopics_Class_Grade form auto-populate the TrainingClassID (it currently does this), TopicClassID, StudentID, TrainingTopicID based off the entry from the above forms.My end goal is that I need to have a grade for each student on each training topic for each class. Like:

Class1-Student1-Topic1-GradeX
Class1-Student1-Topic2-GradeX
Class1-Student2-Topic1-GradeX
Class1-Student2-Topic1-GradeX

View 6 Replies View Related

Form With Subform Doesn't Show Totals Unless Keyed

Aug 2, 2007

I have an application that has two tables, linked on a common key. The main data entry form is for invoices, and has a sub-form for parts used. A similar report/sub-report is used for reporting. Everything is fine for records that are entered via the form. My problem is that when I import data from other sources ( consolidation process ) the calculations are not performed. So when those records are displayed no totals appear until I click on a control that drives the calculations. I don't want to store totals in the database but I need to have them reflected on the viewed form without operator intervention. Otherwise I'm open to incorrect decisions when the operator doesn't notice that an invoice doesn't reflect the cost of parts used.I'm looking for a "one-time" process that I can invoke after loading new data that would "touch" each record (ideally each "new" record but there's no impact to re-calculating existing ones) and drive the calculations so that the viewed form is correct.It doesn't need to be "easy" or automated since the end users won't do it, only myself as part of the data consolidation.Any ideas?Thanks

View 14 Replies View Related

Forms :: Getting Totals From A Subform Into A Field On Main Form

Feb 13, 2015

I have a music database. It's somewhat over the top in terms of the information stored in it, but I like it. My issue is with getting the total number of tracks, as well as the total duration, for a given album (and for each disc, but if I can solve one that should also solve the other).

I have a lot of tables and forms, but for this problem I only need to deal with two of each. They are the tables for albums, the table for tracks, and their associated forms.

In my album table I have information such as album title, artist, release date, and album length. The tracks table contains information on each song - track title, track number, parent album, and track length.

My main form is for the album itself, and contains a subform for the tracks on said album. They correspond to the relevant tables.

What I want to do is obtain the value of the album length by calculating the sum of the track lengths for that album, and the number of tracks. Easy enough - Sum(TrackLength) and Count(TrackID) respectively, both of which can be stored in the footer of the subform.

My problem is that, rather than simply copying those values into text boxes on the main form, I want to copy them into actual fields in the album table. Furthermore, I want them to update as I add or edit the track lengths in the subform.

View 4 Replies View Related

New Record Not Immediately Available To Other Forms

Jun 9, 2015

I have an equipment database with a "main menu" page. There is a button to add vendor. When this button is activated and vendor name is inserted/saved/closed, the newly created vendor isn't immediately available in another form. I have to close out of the database and open it back up before it's visible. What can I do to make the new record immediately available to other forms?

(adsbygoogle = window.adsbygoogle || []).push({});

View 4 Replies View Related

General :: Way To Get Access To Immediately Lock Record

Aug 15, 2013

I have a sales call tracking program.a list of available numbers are displayed to multiple users running the a user clicks on a record to get a call screen displayed with client info they then call the client and try for a sale.

the problem exists that two users can click on the same list record and open up the same call screen - they then both try to call the customer manually on the phone. one agent will get through the other will get a busy signal and record the call as a Busy Call. When the user with the customer is done he tries to record a Sale or No Sale and is met with an error message saying the record has been modified and they cannot save changes!!

I need a way to get access to immediately lock the record when it is clicked so only one person can open the call details screen? What is the best way to lock the records?

View 8 Replies View Related

Access 2007 Runtime Opens And Closes Immediately

Feb 20, 2008

I am having a problem running Access 2007 runtime on a workstation. I have set up the 2007 database (.accdb) on our server and am able to connect to it and open it from the pc that has Access 2007 full version installed and it works fine.

I also installed Access 2007 runtime on another PC and was able to open the database using the runtime version just fine.

However, on this other PC, I installed the runtime version, and when I use the command line (msaccess.exe /runtime \serverdirectorydatabase.accdb) to open the database in runtime mode, Access opens for a split second and then closes immediately.

When I just run msaccess.exe, it opens the runtime version and says that I have not specified a database, as expected. So, I am wondering why it is not opening the database when i DO specifiy the database.

If i specify an incorrect directory for the database, it opens the runtime version and a dialog appears telling me that a database was not found, and upon clicking OK, the program closes.

I can say, that when I run it off the computer that works through the runtime version, I get a security warning telling me that there are potentially unsafe elements in the database, but i just have to click OPEN and it still opens it fine.

Perhaps the non-working PC is denying it access due to these security issues?

I can't seem to figure this out, and any help is appreciated.

View 8 Replies View Related

Modules & VBA :: Dblclick Event Not Firing Immediately From Listbox

Jul 25, 2014

I have an issue with the dblclick event not firing immediately from my listbox. It does eventually fire if i mash the mouse button for long enough but obviously that is not an acceptable solution.The listbox also has an afterupdate event which is what fires when i double click.

I have also tried calling the code from an onclick command button which works fine but if i try and call that from the dblclick event it does not.

I have used the dblclick event in other projects with afterupdate and it has worked without problem.

Code:
Private Sub lstFileList_AfterUpdate()
strPDF = Me.lstFileList.Column(0)
Me.PDFViewer.LoadFile (strPDF)
Dim fso As New FileSystemObject
strFileName = fso.GetFileName(strPDF)

[Code] ....

View 7 Replies View Related

Forms :: Access Database Form Closes Immediately When Open It

Jan 12, 2015

Access database 2007: I have a database with some forms init but when i type my username and password to open the main menu to insert data the form shows 1 second and closes the whole database. I don't know whether the problem is the VB code or the microsoft.

View 14 Replies View Related

General :: New Records Added To Table But Not Immediately Available In Form View

Jul 17, 2014

I have a database created in Access 2003 about six years ago. I’m the sole user of the Application, which I use to keep track of my personal assignments and to quickly access other resources. A search form was added and tweaked over time until it contained the features I desired. The search form uses a subform to display a list of records, with the ability to click a record‘s "Edit" field to open and update that record.

In about March 2014 we upgraded from Office 2003 using Windows XP to Office 2010 using Windows 7. All users on other Applications that I’d designed and support experienced missing Reference issues, but those were resolved rather quickly. I'd been off work intermittently for about six weeks between April and July and gradually started noticing other issues with my personal assignments tracker that I did not immediately associate with the upgrade. Early on, I noticed that I could no longer delete or rename database objects on several of the databases that I'd designed and support. Eventually, I also noticed that I was unable to create new records and received SaveRecord error messages associated with the subform. I'd encountered SaveRecord issues before and went through previous steps to resolve, but to no avail. Eventually, I came to the conclusion, right or wrong, that all of my recent issues were associated with the upgrade.

I found through online research that my loss of ability to delete or rename Objects was possibly due to the loss of Object Owership and Permissions, which was associated with my Security Workgroup. I confirmed that Ownerships and Permissions had been lost and was unwilling to recreate the database, just yet. No user of other Applications that I support reported any problem creating new records.

I know now that new Access doesn’t have the Security menu item that allows Workgroup creation and joining. After months of online research and trial and error, I was directed to Microsoft Knowledgebase Article 918583, which provided VBA code that allowed me to Run the Workgroup Administrator to rejoin my previously established Workgroup.

After rejoining my Workgroup, everything seemed to return to normal. I could delete and rename records and was able to create new records. After a few days, I noticed that new records were not being displayed in the search form right away. I confirmed that the records were being added to the main table, but still not available in the search form, queries, or reports until after an additional record had been added. In other words, for example, in order to view record 1, a record 2 would have to be added. In order to view record 2, a record 3 would have to be added, and so on. This makes it very tedious to enter new assignments.

I believe the present issue is greater than my search form, because the newest record is not only not available in the search form, but not available in any other form, query, or report. I have no clue where to start.

View 2 Replies View Related

Calculated Fields Between Form And Subform

Jul 18, 2005

I have an Invoice Form with a Payments Subform. Here are the details:

frmInvoice
InvoiceID
Customer
ShipmentID
QtyShipped
UnitPrice

frmPaymentsSubform
PaymentID
InvoiceID
CheckNum
DateReceived
Amount

An invoice can be paid in multiple payments. (One-to-Many Relationship).

I have a calculated field that takes QtyShipped * UnitPrice, which gives me my total due. That works correctly. However, I want to have another calculated field that sums all of the payments (the Amount field). Then I want another field that takes the difference between the total due and the sum of all the payments, and gives me a Remaining Due calculated field.

Right now, my TotalPaid and TotalRemaining fields are marked with '#Error'. Is that because TotalPaid is a running sum? Every day I can go in and add a payment to an invoice, so the number would be constantly changing until it was paid in full.

Any suggestions would be great!

View 10 Replies View Related

General :: Calculated Field In Subform?

Nov 14, 2013

I have an invoice form named frmInvoice. It contains a subform named subInvDetails. I am trying unsuccessfully to transfer a calculated subtotal from a text box in subInvDetails to a total in a text box in frmInvoice. Is there a way to do this? I have tried everything I can think of but I can't seem to make it happen.

To be more precise, I have a textbox which is a calculated value ([Rate]*[Hours]) named txtSubTotal in the sub form. In the main form I have a field named txtTotal. I thought that setting the Default Value of txtTotal to =Sum([Forms]![subInvDetail]![Subtotal]) was the right way to it, but the value of txtTotal remained zero. I have also tried using =Sum([Forms]![subInvDetail]![Subtotal]) as txtTotal's Control Source, but that didn't fit my needs or seem like the right way to do it. It didn't work anyway.

View 3 Replies View Related

Forms :: Sum Calculated Field From Subform Datasheet

Feb 8, 2014

I'm trying to sum a couple of columns from a subform datasheet and carry them onto the main form.

My main form, [frm_tours_details], holds subform [sbfTours] which is a datasheet.

On [sbfTours], I've got a couple calculated fields within the datasheet, one, called "txtStudentSum", which calculates number of people total ([students]+[adults]+[numfreeteachers]) and one, called "txtptotal", which calculates fee for the program based on the following formula:

Code:

=IIf([txtMonth]>=10 Or [txtMonth]<=4,([Students]+[Adults])*7,([Students]+[Adults])*8)

(The fee is $8/person in season, and $7/person out of season.)

I've been following online directions I found to put a text box in the form footer which then sums each of these calculated fields ("txtStudentSum" & "txtptotal"), and then reference these text boxes from my main form.

However, the main form text boxes just come up as #Name? or #Error when I try to reference these boxes on the subform. Or, sometimes, the one calculating total students will show the total of ALL students, adults in the database, not just those for this particular record-but only, it seems, if I have the subform open separately first, then load the main form. I also tried putting the whole original calculations into text boxes on the main form, but they will only reflect either the current record selected in the subform, or they will only show the first record, regardless of what you've selected, depending on which way I tried.

I've attached a copy of the database ... click on the tab 'tours', then click on, say, tour #6 (since this one is multiple programs and needs to calculate) to open the tour details form.

View 1 Replies View Related

Forms :: Storing Calculated Control Of A Subform

Jul 5, 2015

Eventhough i know calculated control are for queries, I still need to store a calculated value of a sum. I have a form with customers, dates, locations. That form has a subform that contains the services done and materials used. This subform is in datasheet view. In the footer i have a control with =Sum([Price]).

So I need the value of this control to be stored in the table the main form is based on. I did an unbound control in the main form where the =Me!Subform.Form!.Textx will bring the value "over" Then for the on focus event the vba code Me.Total=Me.Textx stores the value. That is fine. The same works with a command button with the same vba code.

However i am asking if there is a more automatic way to get the value over without the unbound control/command button.

View 7 Replies View Related







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