473,412 Members | 2,174 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,412 software developers and data experts.

data is getting updated properly only reopening the application

I am new to VBA and have very minimum knowledge on it. I have a form with data (records) loaded and when you double click any record in the form, one edit form will be opened where you can edit the data. when I change any data from the edit form the data is not getting reflected in the main form. You can view the correct data only if you close and open the application.

But once you change the data in the edit form and click on save button, the data ia getting updated in the backend properly., where as it is not getting updated in the main form unles you close and reopen the application.

Can you please susggest on this.
Apr 8 '11 #1
2 1634
hype261
207 100+
Basically what you are going to have to do is when you save on the edit form you are going to have to requery the main form.

Psuedo Code

Expand|Select|Wrap|Line Numbers
  1. if (isFormLoaded(mainForm.Name)) Then
  2. Forms![mainForm].Requery
  3. End if
  4.  
Apr 8 '11 #2
NeoPa
32,556 Expert Mod 16PB
Hype is absolutely right. I just thought I'd try to explain what is going on so you can understand why you are seeing what you are seeing.

When you open the main form you will have the Recordset Type set to either Dynaset, Dynaset (inconsistent) or Snapshot. Whichever type is used the form gets the data when it has to (For Snapshot it gets all the records at once and for the others it gets them as they are required - with some buffering), and doesn't get it again until it is triggered to. Dynaset (Dynamic Dataset) types can have the data refreshed from time to time automatically, but Snaphot types, as the name implies, are retrieved once only. As there is no logical linking between the data being updated in the other (Edit) form, and the data displaying for the main form, it is unusual for the updated data to be reflected unless the main form is told specifically to get its data again. This is done with the .Requery or .Refresh methods. .Refresh reflects changes to the data, but only in pre-existing records, whereas .Requery gets all the data again from scratch.
Apr 8 '11 #3

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

Similar topics

1
by: Mountain Man | last post by:
Hi, I posted on this matter earlier with the subject line "Trouble with sessions," but someone else started a different thread with the same subject line that arrived before my post, so I'm...
2
by: Gensek | last post by:
I have a wxPython program, and it has a loop. I want to be able to break the loop by pushing a button. But it doesn't react to events until the loop finishes, which is sort of pointless. What's...
0
by: Anil Kumar Lakky Reddy | last post by:
I have seen lots of people complaining about not getting updated values from edit columns of datagrid. I had similar problem, I figured I was refreshing the data on each page load. I fixed it by...
2
by: nowandever29 | last post by:
I've got an asp.net 1.0 web form, which has a ton of fields. I am NOT using data binding. I programmatically create a data adapter and load the values into a table, then populate the fields on...
1
by: Chetana | last post by:
Hi, How to pass data from one asp.net application to other asp.net application
2
by: vsc33 | last post by:
My vb.net application runs on a sql server 2000 and it is about making bills in a fast running gift counter with 5 to 6 client and server is placed at a distance of 200 meters. The store sells...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why is my AJAX page not updated properly when using an HTTP GET request in Internet Explorer?...
1
by: mail2ranjan | last post by:
How much data can we store in Application variable in ASP.net. Kindly tell me in therms of byte. Thanks in advance. Ranjan Kumar
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...
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
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...
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
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,...
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...
0
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...

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.