By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,828 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,828 IT Pros & Developers. It's quick & easy.

Default values in DSum

P: 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
Share this Question
Share on Google+
5 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
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
Expert 100+
P: 1,418
PEB
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

P: 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
Expert Mod 10K+
P: 14,534
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

P: 76
Wow, y'all are great!

Thanks so much!
Sep 5 '06 #6

Post your reply

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