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

getting error when calculating total using unbound text field in subform

Hi,

Can somebody help me resolve my problem ?
I am getting error when calculating total using unbound textfiled in subform.

I have a main form called purchase_register_master and a subform called purchase_register_details, In sub form i have a unbound textfield called txt_Total_Amount where in i am calculating total amount for different items purchased by giving following code in control source.
ContolSource: =Sum([Amount])
In my main form i have one more unbound text field named txt_Sub_Total
with the controlsource value as.
controlSource : =[Purchase_Register_Details].[Form]![txt_Total_Amount]
but i am getting error, i am not able to make out where is the mistake.
Can anybody help me in this regard?

Thanks and Regards
Sumit
Sep 10 '09 #1

✓ answered by Stewart Ross

Hi. We have an Insight article which provides a full reference on Referring to Items on a Subform.

There is, however, no obvious problem with the subform reference you have listed. You should check that the name of the subform you quote is indeed the name of the object as it is listed in the properties tab for the subform within the main form. If it is, you will need to be systematic in debugging your form - you could start by using the immediate window in the VB editor with the form open (not in design mode) to test values of controls and see what is and is not working as it should.

It would also help us if you would tell us what error you are getting - saves us guessing!

-Stewart

4 3997
Stewart Ross
2,545 Expert Mod 2GB
Hi. We have an Insight article which provides a full reference on Referring to Items on a Subform.

There is, however, no obvious problem with the subform reference you have listed. You should check that the name of the subform you quote is indeed the name of the object as it is listed in the properties tab for the subform within the main form. If it is, you will need to be systematic in debugging your form - you could start by using the immediate window in the VB editor with the form open (not in design mode) to test values of controls and see what is and is not working as it should.

It would also help us if you would tell us what error you are getting - saves us guessing!

-Stewart
Sep 10 '09 #2
NeoPa
32,556 Expert Mod 16PB
Check out Referring to Items on a Sub-Form.

It describes the difference between a SubForm control and a form used as a subform. The latter would typically be included within the former.

PS. Maybe I should have refreshed before posting :(
Well done again Stewart. An exemplary answer.
Sep 10 '09 #3
Thanks Stewart ,
I tried checking the value of controls in immediate window and i got the follwing error
RunTime Error 3270
Property Not Found.
I could not make out why its giving me this error?
Do i need to set any references or something like that?
I really don't know. I am new to Access programming.
Please Help me

Regards Sumit
Sep 11 '09 #4
Stewart Ross
2,545 Expert Mod 2GB
This is not a problem with references. If you are using the immediate window you will need to specify the full form title using the Forms keyword and qualifying it by name (as the simplest method). To show how it is done, here is how you use the VB immediate window to show the value of a subform control in a form open in form view.

The control is named [Total Compliments]

on a subform named frmOverallTotals

within a mainform named frmMainMenu (from one of my apps):

Expand|Select|Wrap|Line Numbers
  1. ? Forms("frmMainMenu")![frmOverallTotals].Form![Total Compliments]
  2.  4 
The value 4 is listed below the question mark, which is the value of the form control mentioned.

The use of the full forms("somename") syntax is covered in the article which NeoPa and I recommended to you.

-Stewart
Sep 11 '09 #5

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

Similar topics

5
by: NB | last post by:
Hi In my 2 years with Access I have never seen this, now it makes me mad In an unbound form frmTH I have a frmList which is a continous form In its on current event, I synch 4 of its fields...
2
by: Alex Wisnoski | last post by:
I have an A97 application that I am modifying. I have created an unbound form, "zfrmTestEnterPlacements", with a subform, "zsfrmSelectPlacement". The intent is to use a combo box on the primary...
4
by: vulcaned | last post by:
Hi All, Hopefully I explain this well........ In Access97 I have a form which has a tab control on it, each tab has a sub-form which is bound to its appropriate table(I'll call them 'Detail'...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
5
by: keith | last post by:
This may seem simple, but I'm having a bit of trouble figuring out exactly how to do it. I'm accessing a database through an ODBC link, and I have a query that returns only jobs completed that day...
2
by: Susan Bricker | last post by:
I went back to read my post and found an error in my description ... here is the post, again, corrected: The following error: "The current field must match the join key '?' in the table that...
30
by: Noob | last post by:
ftp://ukcassassin:winston@www.ukcassassin.pwp.blueyonder.co.uk/htdocs/Diary%20Form.bmp Hi all I will appologise in advance for my lack of knowledge of access and its working as i am quite new to...
1
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
2
by: Andreas | last post by:
Hello together, I want to calculate a sum in subform from a subsubform (sounds complicated?) but I get an #error but... see below My database: I have a main form with members, each members...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
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,...

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.