473,779 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting a flag on a subform as a result of a calculation on it's own subform.

3 New Member
Thank you for being here.

I've bashed my head without help so far, but I'm rapidly running out of time and could use a hand. I don't think it should be too difficult for an experienced Access person.

My structure is I have a "client" form with an "order" subform with an "order details" subform to that.

Client
>Order
>>Order details

The "Order details" subform calculates how many items are yet to be picked up and transfers that number to it's parent subform "Order". One of the fields of the "Order" subform is "Order complete". The "Order complete" checkbox should be set as soon as the value transferred from the "Order details" subform becomes zero and cleared if it is no longer zero.

I don't care if the "Order complete" field on the "Order" subform is activated from the value in the "Order details" subform (=Count([Picked Up])+Sum([Picked Up])) {preferred for elegance} or from the temporary transferred value in the subform "Order".

I've tried lots of things and now need some advice. It takes a village to raise a programmer.

Thanks,
Dave Ussell
Dec 18 '06 #1
3 1750
MMcCarthy
14,534 Recognized Expert Moderator MVP
Thank you for being here.

I've bashed my head without help so far, but I'm rapidly running out of time and could use a hand. I don't think it should be too difficult for an experienced Access person.

My structure is I have a "client" form with an "order" subform with an "order details" subform to that.

Client
>Order
>>Order details

The "Order details" subform calculates how many items are yet to be picked up and transfers that number to it's parent subform "Order". One of the fields of the "Order" subform is "Order complete". The "Order complete" checkbox should be set as soon as the value transferred from the "Order details" subform becomes zero and cleared if it is no longer zero.

I don't care if the "Order complete" field on the "Order" subform is activated from the value in the "Order details" subform (=Count([Picked Up])+Sum([Picked Up])) {preferred for elegance} or from the temporary transferred value in the subform "Order".

I've tried lots of things and now need some advice. It takes a village to raise a programmer.

Thanks,
Dave Ussell
Firstly, i need to know more about the makeup and structure of the order details subform and where this 'value' is stored and/or what it is calculated on exactly.

Secondly, there has to be some trigger to change the order complete status. By that I mean something happens that causes the check to be run on the value.

Can you post the code etc. that you are currently using for all these procedures.

Mary
Dec 19 '06 #2
DaveUssell
3 New Member
Thank you for your response.

Not being very sophisticated there really is no code.

This is what happens. There are three tables involved "Order details", "Orders" and "Customers" with the appropriate one of many links. The form and subforms based upon these tables are "subfrmOrderDet ails", "subfrmOrde rs" and "Customers" respectively. All of the data manipulation works fine however, I need to print reports that sometimes only address incomplete orders and other times only completed orders. Therefore, they need to be differentiated. To do this I have a field in the "Orders" table called "Order complete".

In the "Order details" table there is a checkbox that maintains the picked up status. It is checked when each line item (record) is picked up since they may, or may not, all be picked up at the same time. In the form footer of "Order details" there is a local field called "PickedUpCo unt" which contains the formula =Count([Picked Up])+Sum([Picked Up]) as it's control source. By design this value is zero when no more items are available for pickup.

As a temporary test "probe" on the "subfrmOrde rs" I have placed a temporary text box named "ToBePicked Up" with the formula =[subfrmOrderDeta ils].[Form]![PickedUpCount] for the Control Source. This also works fine and merely indicates how many line items (records) are yet to be picked up. The only part of this that I can't seem to decipher is how to set the "Order complete" field on the "subfrmOrde rs" when either the "PickedUpCo unt" on "subfrmOrderDet ails" or "ToBePicked Up" on "subfrmOrde rs" equals zero (they track and are really the same field but it would be more elegant to use "PickedUpCo unt" on "subfrmOrderDet ails" because that would make the other superfluous).

In short we have
Customers
>Orders ----- w/field "Order complete" set/unset when the count below is 0
>>Order details ----- Contains and passes # of items remaining to be picked up

I know I do not speak the language well. If you want to see the beast you can do so at ftp://ascii27.com/Siesels.mdb

Incidentally, I forgot this is implemented in Access 2000 in case it makes a difference.

Sincere thanks,
Dave
Dec 19 '06 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
Dave,

I've made some changes and it should work for you now. Let me know if you have any problems or don't understand what I've done. The calculated fields are gone and there is an event trigger on the checkbox in the order details subform written in vba.

Siesels_Revised .mdb

Mary
Jan 1 '07 #4

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

Similar topics

2
3751
by: John Hargrove | last post by:
I'm having trouble setting decimal place values in the results field of a sample management database I'm building for an environmental testing laboratory. The degree of sensitivity varies among test methods; consequently, some results are reported to 2 decimal places, some to 3, etc. The Results subform consists of Test Parameter, Result, Report Unit, Analysis Date, Analyst and other fields. The test parameter control is a drop-down...
9
3160
by: chris vettese | last post by:
On my subform I have a field in the footer that totals the value of a field. On the main form I have referenced this field. I'm using this field in a calculation on my main form. The problem occurs when there are no records in the subform. The field on the main form that references the subform total field returns #Error. How can I make this field show the total when there are records and 0 when there are no records??? Thank you,...
1
2937
by: gavo | last post by:
Hello everyone! Using A2K i have a form(a) with a subform(b) and within the subform there is a continuous subform(c). in the subform (b) there is a command button used to call a public function
4
5083
by: Spencer Lee | last post by:
Hi all, I really need some helps. I created a main form("category"), which contains a subform1, "Part". Inside this subform also has contains a subform2, "Inventory". The second level of subform, "Inventory" contains the field of quantity in and out, and therefore I create a text box to do the calculation for UnitOnHand. One textbox is also prepared in subform1, "Part", to get the
1
1638
by: aharding | last post by:
I have a form that displays data. I have a subform I created in the form, saved, deleted from form layout, and a command button that opens that subform. It works perfectly until I try to enter the information into the subform and save it. I get an error when trying to tab out of the subform which states "The Microsoft Jet database engine cannot find a record in the table 'Calculation Lookup Table' with key matching field(s)...
0
866
by: =?Utf-8?B?UnVkeQ==?= | last post by:
Hello all! I have a textbox that hold a numeric value in it. Getting this value from SQL. If the value goes up, I need a message box to pop up. But I also I have another text box that you will also add to that value from a user input. Again, still going throug SQL. So the value would also go up, but because the value was added, not from the result of a calculation. What is the best way to flag so amessage box would only pop up when a...
1
2018
by: Colin Clark | last post by:
Hello, I have a database of scores for a sports club. I want to display a continuous subform showing a person's scores for the season along with a running calculation based on those scores (the handicap), i.e. 3 fields per line in the subform showing date, score, handicap. The handicap needs to be calculated in VBA code as it is fairly complex to work out and depends on previous scores as well as the current score. I can get a query to...
4
1916
meLady
by: meLady | last post by:
Hello, I have a form called feedback with a subform called feedback Options. I did some counting calculation in master form "feedback" at the bottom page. the calculation is about count the number of yes, no and null that are in the feedback Options. the problem is that when navigate to a new form the calculation of the previous form is still in and I tried many times to find a solution but I couldn't ...
1
1138
by: xwjcity | last post by:
Hi everyone: I am new here and I got Calculation problem. thanks in advance.. I have four subforms which retrieve data from different four tables. I created a textbox to do a calculation with the data from four subforms. When I first select a Customer to display on the mainform, the subform's data that related to mainform is correct, but the calculation use Previous Loaded data rather than current data to calculate. And when I select this...
0
9474
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
10305
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...
0
10137
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9928
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8959
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7483
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
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
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.