473,408 Members | 2,832 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,408 software developers and data experts.

#Error in form footer

I'm trying to create a Total field in the footer of a subform.

My initial form uses three boxes to narrow down what will be displayed in the subform. My subform is created off of the query qryPickList. My total field is in the footer of the subform. It's a text field named txtSubTotal. I need to sum all the txtCost fields (displayed as currency) of all the displayed records in the subform.

If I try giving it the Control Source = Sum([txtCost]) I get a #Error message.
If I try giving it the Control Source = [txtCost], it displays correctly.

In the query, txtCost is a calculated field. In the subform, I just display the results.

Any ideas how to get this to work?

Thanks,

minchazo
May 28 '08 #1
3 1985
Stewart Ross
2,545 Expert Mod 2GB
Hi. The error occurring with Sum but not on the direct reference to the same txtCost field suggests that the values in the txtCost field are actually strings, not currency types. This can happen in calculated fields if, say, Nz is used to return non-null values, or Format is used within the calculated field setting. Both these functions return string values.

You can check this by explicitly converting your txtCost value to a currency type for the sum in the footer:

=sum(CCur([txtCost]))

Let is know how you get on.

-Stewart
May 28 '08 #2
I'm not using the Nz function nor the Format function. I double-checked my query and changed the format of the field in the query to 'general number.' I set the format of the txtCost and the txtSubTotal field to 'Currency,' all of this in the properties of the field.

I tried using the formula you suggested =sum(CCur([txtCost])), I get the same error. I tried using CDec instead of CCur and got a popup that the expression was wrong:

The expression you entered has a function containing the wrong number of arguments.

I'll try using the original values I calculated in the query to calculate my total. Anything else I should try?
May 29 '08 #3
I got it! I referenced the value directly from the query instead of using the textbox it was being displayed in.

i.e. instead of using txtCost, I used the "Line Cost" column in the query.

=Sum([Line Cost])
May 29 '08 #4

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

Similar topics

9
by: torbs | last post by:
Hi I am creating a page for stretchfilm. In this page you can chose between a short medium and long version of the film at any point in the film. It is in norwegian, but just press play. URL:...
6
by: dkintheuk | last post by:
Hi all, I'm getting an error when i put a sum in the form footer of a continuous form. I have followed the NWind database exactly (i hope). The conituous form uses a single table name as...
2
by: | last post by:
I have gotten the following error in trying to get totals to come out on a footer. Server Error in '/test' Application....
0
by: news.microsoft.com | last post by:
I am going crazy trying to figure this out, and I am wondering if this is a bug in the ASP.Net implementation. My situation: I have an ASPX page with 2 different modes: *Mode 1: Datagrid...
0
by: Chris S | last post by:
I am going crazy trying to figure this out, and I am wondering if this is a bug in the ASP.Net 1.1 implementation. My situation: I have an ASPX page with 2 different modes: *Mode 1:...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
1
anfetienne
by: anfetienne | last post by:
i take information from a database and then have the collected values entered into a form with hidden fields. <input type="hidden" name="returnURL" id="returnURL" value="<?php print...
3
by: pinko1204 | last post by:
My Update function cannot successful update to sql table even don't have any error. Please help to check .....thx PHP1 <?php require_once 'header.php'; ?> <style type="text/css"> <!--
3
by: graphicssl | last post by:
Okay, so first of all, I'm a designer first and a light coder second (I'm only really trained with HTML and CSS). So I apologize for having to post about something that's probably super-trivial! ...
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
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,...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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...

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.