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

Default values in DSum

76
Hello,

I have created a DSum that will return data from a query. I need the text box in which the DSum function is located to be 0 unless there is a value given by the function. I tried putting 0 in the default value field, but that didn't take care of it. What can I do?

Thanks,

Charlie
Sep 5 '06 #1
5 3321
MMcCarthy
14,534 Expert Mod 8TB
Have a look at the Format Property of the textbox is it set to "General Number". If not do so and the Default Field Value should work.

Hello,

I have created a DSum that will return data from a query. I need the text box in which the DSum function is located to be 0 unless there is a value given by the function. I tried putting 0 in the default value field, but that didn't take care of it. What can I do?

Thanks,

Charlie
Sep 5 '06 #2
PEB
1,418 Expert 1GB
You have to try:

=IIF(Dsum()<0,0,IIF(Dsum()>myfunc(),my_func(),DSum ()))

Voilą!

You have to replace your expression for Dsum with this one

And your expression for your function with my_func()

And it have to work!
Sep 5 '06 #3
ckpoll2
76
OK, I'm sorry to be difficult, but that didn't want to work.

Here is the DSum formula that is currently in there:

=DSum("[Hours]","Leave","Name='Angie Glover' and Type='Sick Leave'")

Can you list exactly how the IIF statement should be entered into the box based on that DSum because it doesn't seem to want to take what I put in and I think that it might be a formatting problem on my part.

Thanks so much,

Charlie
Sep 5 '06 #4
MMcCarthy
14,534 Expert Mod 8TB
Try this:

=IIf(IsNull(DSum("[Hours]","Leave","Name='Angie Glover' and Type='Sick Leave'")),0,DSum("[Hours]","Leave","Name='Angie Glover' and Type='Sick Leave'"))




OK, I'm sorry to be difficult, but that didn't want to work.

Here is the DSum formula that is currently in there:

=DSum("[Hours]","Leave","Name='Angie Glover' and Type='Sick Leave'")

Can you list exactly how the IIF statement should be entered into the box based on that DSum because it doesn't seem to want to take what I put in and I think that it might be a formatting problem on my part.

Thanks so much,

Charlie
Sep 5 '06 #5
ckpoll2
76
Wow, y'all are great!

Thanks so much!
Sep 5 '06 #6

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

Similar topics

3
by: MX1 | last post by:
I have a query written in MS Access that has a few calculated fields. Is it possible to refer to that query in a form field. I'd like the form field to show the sum of one of the columns from the...
0
by: Rolan | last post by:
I'm using Access 97 and need some assistance in sorting out a proper DSum expression, or maybe even DCount might be an alternative. I have tried numerous combinations, but with no apparent success....
2
by: Dalan | last post by:
I seemed to be having problems with structuring the use of NZ with a DSum expression. Having tried numerous variations of the expression without success, I'm asking for assistance. First some...
1
by: gbb0330 | last post by:
Hi All i am trying to calculate Quantity on hand in a unbound textbox in a form with a subform QonHand=Qreceived - TotalQSold TotalQsold=QsoldOnEbay+QsoldThruOtherChannels here is my...
1
by: Pbuck | last post by:
I am running a report that is drawing in data from 5 different queries. The report has five different fields and a sum field to tally up the values in the 5 different fields. The data is loaded...
2
by: valley | last post by:
Hello, I had asked this before but the thread was closed for other reasons. I have two Numeric fields in my Form, MCRef and MCTot. Actually MCtot is the sum of all MCRef for a given Cust_ID I...
33
by: potassium flower | last post by:
I am trying to create a food order system for a restaurant. I have tried using both the DSum and Sum functions to calculate the total cost of an order. The total cost is a textbox on the form...
1
by: danielgoss | last post by:
Hi I have a report that has loads of textboxes that calculate things based on the value on another textbox in the report. I have put a hidden textbox on my report that gets its value from an...
5
by: mabrynda | last post by:
Hi, Is there any possibility to sum all the values in many (say n) columns in a single table using VBA in access 2003? Say I have a table with 200 columns. Say the table name is TableCOUNT and the...
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: 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
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.