473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Getting data to refresh automatically

I have a form for entering various contract information. On that form there are some fields that contain the total budget for the contract, which is a single field in the 'Contracts' table, which is the data source for the table. There is also a field for total invoices and the remaining unspent amount in the contract. The total invoices sum up the amounts from the "Invoices" table for all invoices with that Contract No.
I have a button on the 'Contract' form that opens an 'Invoice' form. The 'Invoice' form shows all existing invoices for the contract and allows you to enter new ones. Then you close the form and you're back to the contract form.
All of this is working fine.
Here's the thing though: When it goes back to the contract form the total invoice amount isn't updated to reflect the changes that were made. If I manually refresh the record it all comes in, but I don't want people to have to know to do that. I haven't been able to find an event where I can put the Refresh command that makes it happen automatically. Can anyone tell me what will do it?
Thanks you.
Feb 7 '08 #1
2 1538
Assuming that you have [frmContracts] open at the same time as [frmInvoices], then you can trigger a refresh of the first form in the close function from the second form:

[Forms]![frmContracts].Requery

You can also requery the Total amount, assuming it feeds from a query:

[Forms]![frmContracts]![varTotalAmount].Requery

Hope that helps!

EDIT: Sorry, forgot to include you can put this in the Form_Close() event. (doh)
Feb 7 '08 #2
Thanks. I used your first suggestion. Much more straightforward than what I was trying to do. (I was trying to get DoCmd.RunCommand AcCmdRefresh to do it, and couldn't figure out how to point it to the Contract table from Event code from the other form.)
Feb 8 '08 #3

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

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
37
by: ajay | last post by:
How to make a web page getting refreshed after a given time interval automatically. HTML Code plz. Tx Ajay
1
by: Bill | last post by:
I have five users using the same forms to enter and retrieve data from an Access database held on a server but the only way each user can see any changes to records is by closing and reopening the...
1
by: JIM.H. | last post by:
Hello, I have a data view linked to a table and a dropdown list for “LastName”. Now once I select something from dropdown list I want the data view refresh itself for selected LastName. I do...
3
by: Jason L James | last post by:
Hi all, I recently wrote a vb.net app using oledb to an access database. When I inserted new rows in my datatable the identity column was automatically created. This app used an un-typed...
3
by: Asus | last post by:
Hello, I'm new to Web Services. I'm trying to develop a Web Service that retrieves some data out of a database and sends them to the client as a DataSet when a method is invoked. My question...
1
by: KatMagic | last post by:
Is there a way to automatically refresh a user control? I have a page where I automatically refresh the page with <meta http-equiv="refresh" content="600"> The page loads a user control based on...
3
by: tshad | last post by:
I have a file that I converted from VB.Net to C# that works fine in VB.Net when I compile but not in C# using the same libraries. The error I am getting is: PageInit.cs(9,7): error CS0138: A...
1
by: doxtor | last post by:
Hi.. I have a form, there is a combo box there name school. Beside there'is a link to open a child window to add a new data school. To open this popup, i use greybox jquery plugin. work ok until...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.