473,569 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refresh Calculated Value on Main form as data is input into subform

1 New Member
Access 2016/Windows 10
I have a pop-up subform where I input numeric values. In my main Form, I calculate the Average, SDev and Count of the values from subform (table) by using an aggregate query. What is the proper syntax for VB code to refresh/requery the aggregate query? I want it updated following each data value is entered.

I assume I add this to either the After Update event or On Current event? Link to screenshot below:
https://1drv.ms/u/s!Arn6mJyTZBnogc4Q...gPzaQ?e=AzPPA0
Nov 1 '21 #1
2 7913
isladogs
457 Recognized Expert Moderator Contributor
Have you tried Me.Recalc?
Nov 2 '21 #2
NeoPa
32,564 Recognized Expert Moderator MVP
The proper syntax would be Call X.Refresh() if no changes were made to add or remove records, but Call X.Requery() if such changes were made.

Unfortunately, your question doesn't make it clear where your VBA code is running from nor how your aggregate query is used within your main form. Both of these are likely to affect what X is.
Nov 3 '21 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1391
by: ethanj /personal/ | last post by:
I have main form with subform, similar to the Order Details form in the Northwind database. The the main form record locking is released when I click to edit subform's records. Is there away to maintain the lock on the main form throughout, until the form is closed? Ethan
4
6985
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which...
1
1800
by: gleave | last post by:
Hi, I have a problem with subforms. I want to lock a subform until all the required data is inputted in the main form. The required fields in main form: Invoice Number Invoice to The main form is called: Invoicing And the subform is called:
0
1589
by: theBman | last post by:
I have 2 tables. One master, one child using Access 2003 (PC) Have 2 forms. The main form is continuous while the sub is datasheet. I can filter on the main form and the subform filters with it. No problem. My goal is to be able to filter on the subform and have the main form filtered with it. Thought it would be simple but I for a...
1
2408
by: Elainie | last post by:
I have a main form and in it I have a datasheet subform filtered on surname, I would like the users to select a name in their list on the subform then the data moves up into the main form... Is there a way of doing this? Tried a lot of different things but it doesnt want to play... HELP!
2
3962
by: stpark22 | last post by:
Hello, I've constructed a form that contains a subform in Access 2003. I want to be able to set the tab order to tab through the fields of the main forms then tab through the fieldw of the subform and then back to the main form. However, the subform tabs wont move beyond the subform once the cursor reaches the subform. Is there anyway to alter...
27
29228
by: tragaz | last post by:
Hi There, I'm a beginer in Access and VB. In my Database, I've got a form with a subform. the subform is a query from a table different than the table of the main form. those tables don't have a link yet. the main form is being use to create a new entry/ a new row in the table. What I want to do is use the primery key from the main form...
30
2349
by: mminieri | last post by:
My main form has many tabbed subform pages, and a button for NEW record and one for EXISTING record. A user can access a specific existing record from a dropdown combobox that opens from that command button. Selecting a record returns to the MAIN form and populates all fields including those on all subforms. The subform tabs are NOT VISIBLE when...
7
2121
by: GeneH | last post by:
Hello, I am trying to requery a control on a main form from an AfterUpdate event of a control on a subform and then return back to the record and control at the subform. Instead i am returned to the first record of the subform. When i debug, it seems correct, the record i want does show correct at the findfirst statement. but at the form the...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.