473,473 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Force a table to update

I am using the following code to display the total of the amount field in
the Position table.

Private Sub txtTotal_Click()
Dim curX As Long
curX = DSum("[amount]", "position")
txtTotal.Text = CStr(curX)
End Sub

The txtTotal.Text is computed and displayed okay.
However when I update the amount field on the screen the new value for
txtTotal.Text doesn't change unless I close the Access Database and reopen
it.
Can I force the updated value of the amount field to to be saved in the
position table without actually closing the database?

Dec 6 '06 #1
1 2590
The value has changed, but the display has not. You need to requery the
control. see Help

Control.requery

"RICHARD BROMBERG" <no*****@att.netwrote in message
news:Ub********************@bgtnsc05-news.ops.worldnet.att.net...
>I am using the following code to display the total of the amount field in
the Position table.

Private Sub txtTotal_Click()
Dim curX As Long
curX = DSum("[amount]", "position")
txtTotal.Text = CStr(curX)
End Sub

The txtTotal.Text is computed and displayed okay.
However when I update the amount field on the screen the new value for
txtTotal.Text doesn't change unless I close the Access Database and reopen
it.
Can I force the updated value of the amount field to to be saved in the
position table without actually closing the database?


Dec 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Charles Soto | last post by:
I've got a main loop script that calls two other scripts that do no user interaction. All they do is send a couple of mysql update statements. Then they use header() to call the main loop again. ...
2
by: grist2mill | last post by:
I have a table 'Group2Operation' that stores many to many relations between the 'Group' table and the 'Operation' table (each group is has permission to perform one or more of the available...
9
by: Daniel Kay | last post by:
Hello! I have written two template classes which implement the observerpattern in C++. I hope I manage to desribe the problem I have. template<class T> class Observer { /* ... */ }; ...
3
by: Jerry Hull | last post by:
I've got a very simple database, with a report that the user wants to be able to print for a single record immediately after entering the data. I've created a button on the data entry form that...
3
by: buht | last post by:
Hello Everyone, Fairly new to c# here and have a question regarding scrollbars, particularly a vertical scrollbar. It looks like my options are restricted for the textbox scrollbars being...
5
by: JohnR | last post by:
I have multiple controls set to the same database and, normally, when I change the record in one control the position is also changed in the other controls because I have "syncwithcurrencymanager'...
6
by: bryanbabula | last post by:
I have a question about overriding i was wondering if anyone could help me with, or even suggesting a better/different way. I have no idea if this can even be done or not. I was wondering if there...
3
by: Andy_Khosravi | last post by:
I have a method in place in my application to force users out. It's a simple tactic I got from these newsgroups where you create a table with one record called logout, then check that field with a...
2
by: Oleg Subachev | last post by:
I have DataGridView which DataSource is assigned to Table<> object of DataContext connected to SQL Server database. But when the underlying SQL Server database is updated (through ODBC...
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
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...
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...
1
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
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.