Hello:
I have two fields on a table that is displayed on my continous form.
GWP = Number
Binding Percentage = Text (a value list of 25%, 50%, 90% & 100%)
I have a unbound text box that I placed in the footer and in the control source I wrote the following:
This works but now I am trying to write this code to only sum the "GWP" where the value list of my binding percentage field is 50% or greater. I tried this: -
=sum(iif((Binding_Percentage)=50%))
-
but I keep on getting complile errors. I think because the value list is text.
Can anybody assist?
Thanks
18 2164
Hello:
I have two fields on a table that is displayed on my continous form.
GWP = Number
Binding Percentage = Text (a value list of 25%, 50%, 90% & 100%)
I have a unbound text box that I placed in the footer and in the control source I wrote the following:
This works but now I am trying to write this code to only sum the "GWP" where the value list of my binding percentage field is 50% or greater. I tried this: -
=sum(iif((Binding_Percentage)=50%))
-
but I keep on getting complile errors. I think because the value list is text.
Can anybody assist?
Thanks
Assuming your Table Name is Table1, and you are including 'ALL' the Records from Table1 in the Continuous Form: - =DSum("[GWP]","Table1","Val([Binding_Percentage]) >= 50")
Assuming your Table Name is Table1, and you are including 'ALL' the Records from Table1 in the Continuous Form: - =DSum("[GWP]","Table1","Val([Binding_Percentage]) >= 50")
Actually my continous form's record source is driven by a query called "ReQryForecast" Will that make a difference ADezii?
Actually my continous form's record source is driven by a query called "ReQryForecast" Will that make a difference ADezii?
Figured it out, Thanks!! -
=DSum("[GWP]","ReQryForecast","Val([Binding_Percentage]) >= 50")
-
Thanks for all the help I was reading about the VAL method last night and will use it in the future.
Best regards,
Keith.
Thanks for all the help I was reading about the VAL method last night and will use it in the future.
Best regards,
Keith.
You are quite welcome, Keith.
You are quite welcome, Keith.
ADezii:
Hello again, I have one more situation regarding this subject. Currently I have the text box's control source, SumGWP, set to: - =DSum("[GWP]","ReQryForecast","Val([Binding_Percentage]) >= 75")
if "Binding_Percentage" is < 75 than my unbound text box "SumGWP" is blank even when I set its default value property to 0. I thought I would apply the Nz expression below: - =DSum(Nz([GWP],0),"ReQryForecast","Val([Binding_Percentage]) >= 75")
But that did not work either. How would I best approach this scenario so that it will populate a 0 instead of a blank if "Binding_Percentage" is < 75?
Thanks and hope all is well,
Best regards,
Keith.
ADezii:
Hello again, I have one more situation regarding this subject. Currently I have the text box's control source, SumGWP, set to: - =DSum("[GWP]","ReQryForecast","Val([Binding_Percentage]) >= 75")
if "Binding_Percentage" is < 75 than my unbound text box "SumGWP" is blank even when I set its default value property to 0. I thought I would apply the Nz expression below: - =DSum(Nz([GWP],0),"ReQryForecast","Val([Binding_Percentage]) >= 75")
But that did not work either. How would I best approach this scenario so that it will populate a 0 instead of a blank if "Binding_Percentage" is < 75?
Thanks and hope all is well,
Best regards,
Keith.
Try: -
=IIf(Val([Binding_Percentage]) < 75, 0, DSum([GWP], "ReQryForecast"))
Your great, worked perfectly......
Thanks,
Keith.
Your great, worked perfectly......
Thanks,
Keith.
You are quite welcome, Keith.
Sorry Adizzii:
I thought I was done with this but it is now given me the 0 when less than 75 but not doing anthing when it is >=75.....
Any ideas?
Thanks Keith.
Sorry Adizzii:
I thought I was done with this but it is now given me the 0 when less than 75 but not doing anthing when it is >=75.....
Any ideas?
Thanks Keith.
Try - =IIf(Val([Binding_Percentage]) < 75, 0, DSum("[GWP]", "ReQryForecast", "[Binding_Percentage] > = 75"))
Try - =IIf(Val([Binding_Percentage]) < 75, 0, DSum("[GWP]", "ReQryForecast", "[Binding_Percentage] > = 75"))
ADezii:
Once I selected 75 or greater I received a #Error.....in the unbound text box. It did still place a "0" when I selected something less than 75.
I have read so much on Nz and Null values but still find it very confusing. Your thoughts?
Thanks,
Keith.
ADezii:
Once I selected 75 or greater I received a #Error.....in the unbound text box. It did still place a "0" when I selected something less than 75.
I have read so much on Nz and Null values but still find it very confusing. Your thoughts?
Thanks,
Keith.
Does the [Binding_Percentage] Field contain strictly Numeric values, namely: 50, 60, 75, 80, etc...?
Does the [Binding_Percentage] Field contain strictly Numeric values, namely: 50, 60, 75, 80, etc...?
ADezii:
[Binding_Percentage] is a combo box whose row source type is set to a value list. I have the row source set to:
"0%";"50%";"75%";"100%"
I used the "Val" because [Binding_Percentage] is a text box.
Thanks,
Keith.
ADezii:
[Binding_Percentage] is a combo box whose row source type is set to a value list. I have the row source set to:
"0%";"50%";"75%";"100%"
I used the "Val" because [Binding_Percentage] is a text box.
Thanks,
Keith.
You have got me thinking. I changed [Binding_Percentage] to a number and set the row source set to:
0;50;75;100
Let me see if that changed anything,
Thanks,
Keith.
That solved the problems and also eliminated other issues I was having except one.... I will open another thread to address that one.
Thanks!
Keith.
That solved the problems and also eliminated other issues I was having except one.... I will open another thread to address that one.
Thanks!
Keith.
Anytime Keith, but you basically solved it yourself! (LOL).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Yaroslav Bulatov |
last post by:
I made an array of 10 million floats timed how long it takes to sum
the elements, here's what I got (millis):
gcc -O2: 21
Python with numarray: 104
Python with Numeric: 302...
|
by: Targa |
last post by:
<input NAME="TAXRATE" onBlur="this.form.TAX.value =
(this.form.TAXRATE.value - 0) * (this.form.ITEM1TOTAL.value - 0) +
(this.form.ITEM2TOTAL.value - 0) " Size="4">
In my TAX field I get...
|
by: Hank |
last post by:
I have a report-summing problem using Access 2000. When a section runs
over the end of the page, sometimes a detail gets picked up twice.
Example:
Customer Header
XYZ Company
Detail Section...
|
by: astro |
last post by:
Anyone have suggestions on where to troubleshoot this error?
Background:
-Access 2k v. 9.0.6926 sp3
- front and backend on production server (wiindows 2k)
-accessed via Citrix
-front-end is...
|
by: King |
last post by:
Hi
I have two queries where in I calculated number of hours worked by an
employee.
Fields for the first query
Meeting Id ( Auto Number )
Counselor ID ( text )
Date
|
by: dancole42 |
last post by:
So I have an invoicing database based on two main forms: Orders and
OrderLines. Orders has fields like:
OrderID
BillingMethod
OrderDate
CreditCard
CCExp
OrdSubTotal
ShippingCharge
|
by: NewlytoSQL |
last post by:
Hi all, im fairly new to SQL and im stuck half way through a query,
im using DB2 here is what im tryng to do.
i have a query that brings back an item number , shelf req, sum of all orders columns,...
|
by: kbeana |
last post by:
I can't figure this out for the life of me. I have several fields that are set up as currency, and all have a decimal place of 2. I am summing some of them in the report footer, and it will be a...
|
by: OllyJ |
last post by:
Hi guys hope you can help
I have a text box for each day of the week in a form and numbers are entered into them (but sometimes they need to be left blank i.e. not 0). I am summing these values...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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: 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,...
|
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...
|
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...
|
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,...
| |