473,320 Members | 1,921 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,320 software developers and data experts.

Updating Fields On A Form

I have a form, which I'll call Form1. It's bound to a table (Table1).
Form1 has three fields Field1, Field2 and Field3 which correspond to
fields in Table1. Field3 is the sum of Field1 + Field2. I have an
AfterUpdate event which runs a macro if Field1 or Field2 are updated.
The macro (which calls a query) does run BUT Field3 does not reflect an
updated value on Form1 (or in Table1) unless I go through some
gyrations such as going to the next record and then back to the
original record. I'm probably missing something basic but am at a loss
as to what that is. Any help/suggestions would be appreciated.
Thanks, Sheldon Potolsky

Nov 28 '06 #1
4 1533
Sheldon wrote:
I have a form, which I'll call Form1. It's bound to a table (Table1).
Form1 has three fields Field1, Field2 and Field3 which correspond to
fields in Table1. Field3 is the sum of Field1 + Field2. I have an
AfterUpdate event which runs a macro if Field1 or Field2 are updated.
The macro (which calls a query) does run BUT Field3 does not reflect an
updated value on Form1 (or in Table1) unless I go through some
gyrations such as going to the next record and then back to the
original record. I'm probably missing something basic but am at a loss
as to what that is. Any help/suggestions would be appreciated.
Thanks, Sheldon Potolsky
Yes, you are missing something basic, Sheldon. It is very likely that
there is no point in storing the value of Field3 anywhere; it can be
calculated and displayed the moment you open your form. Generally, it
is not recommended to store values that can be calculated from others.

Alexandre Bejerman
Montreal, Canada

Nov 28 '06 #2
Try Me.recalc, since it is a calculated field.

--
Darryl Kerkeslager
Nov 28 '06 #3

ab****@hotmail.com wrote:
Yes, you are missing something basic, Sheldon. It is very likely that
there is no point in storing the value of Field3 anywhere; it can be
calculated and displayed the moment you open your form. Generally, it
is not recommended to store values that can be calculated from others.

Alexandre Bejerman
Montreal, Canada
Thanks for the quick suggestion Alexandre. However, I do need Field3
updated/displayed on Form1 as well as updated in Table1.
Sheldon

Nov 30 '06 #4
I used Me.Recalc in an After Update event to update Field3 and
an(other) After Update event for the entire form which ran my update
query as soon as my calculated field was updated and updated table
values. Thanks to those of you that helped.
Sheldon Potolsky

Sheldon wrote:
ab****@hotmail.com wrote:
Yes, you are missing something basic, Sheldon. It is very likely that
there is no point in storing the value of Field3 anywhere; it can be
calculated and displayed the moment you open your form. Generally, it
is not recommended to store values that can be calculated from others.

Alexandre Bejerman
Montreal, Canada

Thanks for the quick suggestion Alexandre. However, I do need Field3
updated/displayed on Form1 as well as updated in Table1.
Sheldon
Nov 30 '06 #5

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

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
5
by: Richard Stanton | last post by:
Hello all My database has a main form linked to table1. It has several subforms on the main form, all linked to table2. Table1 and Table2 are linked by primary/foreign key, no duplicates...
3
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated...
3
by: Tc | last post by:
Hi, I was curious, I am thinking of writing an application that loads a dataset from a database that resides on a server. The question I have is this, if multiple copies of the app will be...
1
by: Spock | last post by:
Hi. I have a form with a listbox and a few label fields all bound to a dataset. When i navigate the listbox the labels change accordingly. so far everything works good. I made a button to...
9
by: Kevin Blount | last post by:
Here's the code I tried, and found it failed... <form runat="server" method="post" name="CreditCardForm" id="CreditCardForm"> <% foreach (object item in Request.Form) { if...
1
by: EyeHawk | last post by:
OK, hopefully somebody can help me out again. My next problem is updating 3 form fields (type list/menu option) that correspond to a date, one for month, one for day and one for year when the user...
4
by: AlexNunley | last post by:
I've adopted a moderately sized (65k records) active use database (Access 2000, Windows XP). One of the most commonly used forms is whats called the RMA generation field, used to add claim...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.