473,654 Members | 3,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms and Subforms - Many Calculations

I'm looking for advice on how to perform calculations on my forms.
Iwill try to explain the situation as clearly as possible.

I have a form that has multiple sub-forms. Some of these sub-forms
have sub-forms in themselves. On Each of these forms there are
calculation fields. Some of these calculations use data from the
parent form. Here are my questions:

1 - What is the best way/best event to have fields I want to save in
the underlying tables make equal to the calculation fields. For
example:
On a subform I have a calculation field (unbound) that calculates the
part weight. I have a bound field called part weight that I want to
have = the unbound field. I tried to code this on the On Current
event and it locks up the forms.

2 - What is the best way to have all of these calculation fields
update after fields on the parent form are updated. I'd like to stay
away from a Calculate command button. I want the fields to refresh on
their own. Does a simple refresgh command on the main form refresh
all of the subforms?

Thank you for your help!

Chris
Nov 12 '05 #1
1 2276
Look at it this way -
If the value of one of the fields which is used to calculate Part Weight
changes, do you want Part Weight to change for that record?
If the answer is yes, then it's unwise to store the Part Weight value at
all -
just store the component fields, and recalculate Part Weight
whenever you need it.
If the answer is no, then your situation is more complex, because you
will need to specify under what conditions it will be recalculated, and
under what conditions it will not.
It's best to have all of that figured out before you begin to code.

HTH
- Turtle

"chris vettese" <ch**********@y ahoo.com> wrote in message
news:40******** *************** ***@posting.goo gle.com...
I'm looking for advice on how to perform calculations on my forms.
Iwill try to explain the situation as clearly as possible.

I have a form that has multiple sub-forms. Some of these sub-forms
have sub-forms in themselves. On Each of these forms there are
calculation fields. Some of these calculations use data from the
parent form. Here are my questions:

1 - What is the best way/best event to have fields I want to save in
the underlying tables make equal to the calculation fields. For
example:
On a subform I have a calculation field (unbound) that calculates the
part weight. I have a bound field called part weight that I want to
have = the unbound field. I tried to code this on the On Current
event and it locks up the forms.

2 - What is the best way to have all of these calculation fields
update after fields on the parent form are updated. I'd like to stay
away from a Calculate command button. I want the fields to refresh on
their own. Does a simple refresgh command on the main form refresh
all of the subforms?

Thank you for your help!

Chris

Nov 12 '05 #2

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

Similar topics

1
2254
by: John Mudd | last post by:
I come from the Access environment where all the windows form handles were hidden so pardon my question. In Access I could make "continuous" subforms and there was a subform "container" object I could place on a form and then reference the subform and easily link the two together with a master/child link. The mastery of just how it worked was hidden from the average user. I have the dataset side working fine with multiple
25
6194
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I rarely refer to a subform ir parent form's controls or records from the other form. Instead, I call a procedure in that form that does the job. That's all fine and good, and nothing at all revolutionary, but it leaves one with an annoying...
3
2352
by: godber | last post by:
I am having difficulty in adding a subform into my existing form, I have designed very simply databases in the past & this is my first attempt at compiling subforms - with little success I may add. In a nutshell I have multiple variable data (defects) which occur on one product, on one day etc. etc.. Can anyone advise of any literature that may be of use. look forward to your replies.
4
1697
by: Luisa Lopes | last post by:
Dear colleagues: I read somewhere that you could obtain the results of a query as a form. I have design a database for my books and waht I would like is to obtain the results of my queries (which use parameters for language, author, genre, etc) in the form of a bunch of the original forms I used for creating the book entries. I don't know if I explained the problem correctly. As a result of a query I
1
2964
by: tconway | last post by:
I have an Access program that displays Customer data into a form and OrderID data into a subform. The totals in the Subform are based on calculated fields, i.e. the Total Amount field Calculates the following: =* The Subform Order fields are pulled from a Query along with each calculated Total. They are displyed in a DataSheet View. This works fine on my developement environment which includes a server set up just as our client has. ...
8
3087
by: Zlatko Matiæ | last post by:
Hello. How can I synchronize subforms content with current record in master form, if both form and subform are based on DAO code ? I assigned DAO recordset to forms by using QueryDef, on Load event. Thanks...
4
1777
by: sparks | last post by:
OK we have it so we can use tables to define skip patterns on our forms. BUT we can only do one form. Public Function skipPattern(currentFrm As Form, Optional currentCtl As Control = Null) As Integer the current form. ouch. this works fine as long as the controls are all on one form.
11
8120
by: elaina | last post by:
Hello again. I have setup a master form linked to a subform (actually nested subforms, but the top level subform is the one giving me trouble.) When entering data, the forms all appear to work correctly, but the moment that you change the record in the parent/master form, the forms "lose" all of the data we enter from the subforms. Upon examination of the tables, I found that the master key is not being populated into the top level subform,...
21
3338
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters a zipcode that is unknown this form will open. I don't want users to modify any of this customers data until they close the zipcode form. Normally this can accomplished using a modal form, however this prevents me from opening a new copy of...
0
8375
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8482
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6161
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.