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

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 2261
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**********@yahoo.com> wrote in message
news:40**************************@posting.google.c om...
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
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...
25
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...
3
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....
4
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...
1
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...
8
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...
4
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...
11
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...
21
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.