I have a subform named "sbfrmParts " with a list of parts along with the
quantity and price. I have used a text box in the subform's footer and set
the control source to "=Sum([NET PRICE]*[Quantity])". I set the format to
display currency. This text box is called "SubformTot al", and is visible
property is set to "No". On the main form I have made another text box and
set its control source to "=[sbfrmParts].Form!SubformTo tal".
When I enter some parts everything works perfectly until I look at the text
box on the main form. It only displays "#Error".
What is wrong?
Any suggestions?
Shannan Casteel
--
Message posted via AccessMonster.c om http://www.accessmonster.com/Uwe/For...ccess/200508/1 30 8906
A calculated control will update itself when you change the other controls
it is based on if those controls are on the same form. When they are on a
different form, such as a subform, then you need to tell the calculated
control to update. To have it update after you add each new record to the
subform, in the subform's Current event try:
Me.Parent.NameO fControlOnMainF orm.Requery
--
Wayne Morgan
MS Access MVP
"Shannan Casteel via AccessMonster.c om" <fo***@AccessMo nster.com> wrote in
message news:53******** ***@AccessMonst er.com... I have a subform named "sbfrmParts " with a list of parts along with the quantity and price. I have used a text box in the subform's footer and set the control source to "=Sum([NET PRICE]*[Quantity])". I set the format to display currency. This text box is called "SubformTot al", and is visible property is set to "No". On the main form I have made another text box and set its control source to "=[sbfrmParts].Form!SubformTo tal".
When I enter some parts everything works perfectly until I look at the text box on the main form. It only displays "#Error".
What is wrong?
Any suggestions?
Shannan Casteel
-- Message posted via AccessMonster.c om http://www.accessmonster.com/Uwe/For...ccess/200508/1
Wayne,
Thanks for your reply. I tried entering "Me.Parent.Main FormTotal.Reque ry" in
the OnCurrent event of the subform, but it still returns "#Error" in the
MainFormTotal text box on the main form. My subform is based on a query.
Don't know if that matters, just thought I'd tell you.
Thanks for the help.
Wayne Morgan wrote: A calculated control will update itself when you change the other controls it is based on if those controls are on the same form. When they are on a different form, such as a subform, then you need to tell the calculated control to update. To have it update after you add each new record to the subform, in the subform's Current event try:
Me.Parent.Name OfControlOnMain Form.Requery
I have a subform named "sbfrmParts " with a list of parts along with the quantity and price. I have used a text box in the subform's footer and [quoted text clipped - 14 lines] Shannan Casteel
--
Message posted via AccessMonster.c om http://www.accessmonster.com/Uwe/For...ccess/200508/1
Going back to your original statement, the brackets should be as follows:
=sbfrmParts.For m!SubformTotal
On my main form textbox which refers to a control on the subform, Access
tried adding brackets but it worked after I removed them. It usually adds
what it needs, but not always and sometimes too much. Also, sbfrmParts
should be the name of the subform control on the main form, not the name of
the subform itself; however, they may both be the same.
--
Wayne Morgan
MS Access MVP
"Shannan Casteel via AccessMonster.c om" <fo***@AccessMo nster.com> wrote in
message news:53******** ***@AccessMonst er.com... Wayne,
Thanks for your reply. I tried entering "Me.Parent.Main FormTotal.Reque ry" in the OnCurrent event of the subform, but it still returns "#Error" in the MainFormTotal text box on the main form. My subform is based on a query. Don't know if that matters, just thought I'd tell you.
"Shannan Casteel via AccessMonster.c om"
<fo***@AccessMo nster.com> wrote in
news:53******** ***@AccessMonst er.com: Wayne,
Thanks for your reply. I tried entering "Me.Parent.Main FormTotal.Reque ry" in the OnCurrent event of the subform, but it still returns "#Error" in the MainFormTotal text box on the main form. My subform is based on a query. Don't know if that matters, just thought I'd tell you.
Thanks for the help.
An alternate approach is to leave the textbox on the main form
unbound, and put code in the subform's AfterUpdate Event to set the
textbox on the mainform's value
e.g. parent!subformT otal = me.subformTotal
--
Bob Quintal
PA is y I've altered my email address.
I tried deleting the brackets around the formula, but Access just keeps
adding them back in. How'd you do that.
Shannan
Bob Quintal wrote: Wayne, [quoted text clipped - 6 lines] Thanks for the help.
An alternate approach is to leave the textbox on the main form unbound, and put code in the subform's AfterUpdate Event to set the textbox on the mainform's value
e.g. parent!subformT otal = me.subformTotal
--
Message posted via AccessMonster.c om http://www.accessmonster.com/Uwe/For...ccess/200508/1
I also tried Bob's approach, but it didn't seem to do anything. When I went
back to the main form the text box was blank.
Shannan
Bob Quintal wrote: Wayne, [quoted text clipped - 6 lines] Thanks for the help.
An alternate approach is to leave the textbox on the main form unbound, and put code in the subform's AfterUpdate Event to set the textbox on the mainform's value
e.g. parent!subformT otal = me.subformTotal
--
Message posted via AccessMonster.c om http://www.accessmonster.com/Uwe/For...ccess/200508/1
Guys,
I went to the Northwind sample database and checked all the syntax and it was
exactly the same as mine. I don't know what is wrong. Something in
properties maybe? This is driving me nuts.
Shannan
Shannan Casteel wrote: I also tried Bob's approach, but it didn't seem to do anything. When I went back to the main form the text box was blank.
Shannan
Wayne,
[quoted text clipped - 7 lines] e.g. parent!subformT otal = me.subformTotal
--
Message posted via AccessMonster.c om http://www.accessmonster.com/Uwe/For...ccess/200508/1
If both methods aren't working, then I would suspect that one of the
controls' or forms' name is wrong.
--
Wayne Morgan
MS Access MVP
"Shannan Casteel via AccessMonster.c om" <fo***@AccessMo nster.com> wrote in
message news:53******** ***@AccessMonst er.com... Guys,
I went to the Northwind sample database and checked all the syntax and it was exactly the same as mine. I don't know what is wrong. Something in properties maybe? This is driving me nuts.
Wayne,
Here is how it is setup. I went and double checked just to be sure.
Subform Name: sbfrmParts
Main Form Name: frmClaim
Subform text box name: SubformTotal
Main Form text box name: MainFormTotal
Main Form text box control source: = [sbfrmParts].Form!SubformTo tal
I could not get those last set of brackets to go away. The text box on the
main form still displays "#Error".
What's wrong?
Wayne Morgan wrote: If both methods aren't working, then I would suspect that one of the controls' or forms' name is wrong.
Guys,
I went to the Northwind sample database and checked all the syntax and it was exactly the same as mine. I don't know what is wrong. Something in properties maybe? This is driving me nuts.
--
Message posted via AccessMonster.c om http://www.accessmonster.com/Uwe/For...ccess/200508/1 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Allen Browne |
last post by:
Subform is based on a single-table query that contains a calculated field:
Amount: Round(CCur(Nz(*,0)),2)
Continuous subform displays this field in a text box named Amount.
As user enters new rows into subform, all rows show #Error in this box.
This only happens until they close the form, or move the main form to a
different record.
Worse, it only happens on the client's machine in the MDE.
The identical MDB file shows the calculation...
|
by: chris vettese |
last post by:
I've been having trouble with this for a long time. I have a form
that has many subforms. In the subforms I have unbound text boxes in
the footer that sum a field. I want to Display this sum on the main
form for each subform and then add them all together. In a book I
have it gives the following example:
=(Object type!!.Form!)
I created an unbound text box on my main form and filled in the
information in the example above and get a...
|
by: Ellen Manning |
last post by:
I've got an A2K form with a subform based on a query. This query has
a checkbox and an amount field and returns records if checkbox is
checked. I Dsum the amount field and display on the main form. If
the user unchecks the box, I want the corresponding amount subtracted
from the total. If they recheck the box, the amount is to be added.
I want all records to appear on the subform even after unchecking
them. This works fine...except......
|
by: Lyn |
last post by:
Hi,
I am working on a genealogy form. The only table (so far) lists everybody
in the family, one record per person. Each record has an autonum ID.
The parent form (frmMainForm) displays the data in each record, which
includes the ID of the father and the mother (who also have records in the
table). One record per form.
I have a Tab Control in the form, and in one of the tabs I have a subform
(sfmSiblings) in which I wish to list...
|
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. ...
| |
by: Mark |
last post by:
Hi all,
I'm completely new to access and am trying to create a simple form/subform.
The main form will include:
employee_number,
forename,
surname,
total_leave,
leave_remaining (to be calculated)
|
by: jburris |
last post by:
I have been through enough of these threads to think that this should
be an easy fix... but, are there circumstances in which the following
code syntax does not work?
=!!.Form! (this is
out of the Access bible)
Specifically, I am adapting the Orders database from the Access
templates for my use. I deleted the payments table and am recording
them as a field in the Order Details table so that
payment is directly tied to each product...
|
by: Bruce |
last post by:
Hi,
I have 3 nested forms and wish to calculate a value on Subform 1 by
adding 2 values on the same subform + to a value in a
control on the footer of the underlying subform
. I use this as the recordsource for my total
=.Form!Sumpd++)
which works well except when there are no records in the
transactiontbl subform - I get an error.
|
by: Jimmy Stewart |
last post by:
I want to use a calculated function for the caption on my tab controls. I
used the following code:
Me.Page28.Caption = "Expenses & "]"
This should display the following: " Expenses " where 10 is the number
of expenses on that page. On my form I have a calculated control named
'ExpenseEntryCount' that correctly displayd this information.
If I place this code in the forms OnOpen, OnActivate or OnCurrent event,
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |