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

How to use dsum function in unbound form?

I have form called "FocusEntry" with unbound field

There are three field named with three different field name

1-Safe
2-AtRisk
3-TotalObserved
4-Safe

In "observed" Control Source i have wrote code as following =(Val(Nz([Safe]))+Val(Nz([AtRisk]))) to get total sum

In "Safe" Control Source i have wrote =
Expand|Select|Wrap|Line Numbers
  1. (Val(Nz([Safe]))/Val(Nz([Obser]))) 
to get total percent (Format is percent)

and at the bottom of form i have added this code to get overall percent and here is the code =
Expand|Select|Wrap|Line Numbers
  1. (Val(Nz([Total]))+Val(Nz([Total1]))+Val(Nz([Total2]))+Val(Nz([Total3]))+Val(Nz([Total4]))+Val(Nz([Total5]))+Val(Nz([Total6]))+Val(Nz([Total7]))+Val(Nz([Total8]))+Val(Nz([Total9]))+Val(Nz([Total10]))+Val(Nz([Total11]))+Val(Nz([Total12]))+Val(Nz([Total13]))+Val(Nz([Total14]))+Val(Nz([Total15]))+Val(Nz([Total16])))/17 
My question is how can have the 0% value when form open? Right now whenever i open the form i have default like this "#num!

also same Default i have having at the bottom as i have overall total sum

I need help:

How can i have Default as 0% percent when form open. I want bottom form to sum as i start updating the form and show me the total percent

Prompt reply much appreciated. If any more explaination i will

Please help
Jul 21 '11 #1
6 2698
Rabbit
12,516 Expert Mod 8TB
For Nz() to work, you need a second parameter. The second parameter tells it what to return in the case that the first parameter is a null.
Jul 21 '11 #2
Rabbit, i Just fixed my problems but i still prefer to see your codes. Can i have the example?

Thanks
Jul 21 '11 #3
Rabbit
12,516 Expert Mod 8TB
Basically, you would need to do this so it would return a 0 if safe is null.
Expand|Select|Wrap|Line Numbers
  1. Nz([Safe], 0)
Jul 21 '11 #4
Rabbit,

Is there any VBA codes for sum or dsum function. As i fixed the problems yesterday occurred another.

I want VBA to sum two value in one unbound textbox.

example:

Text Text Text Text
Safe + AtRisk = Observed Total%
Safe1+ AtRisk = Observed Total%


Any help?
Jul 22 '11 #5
Rabbit
12,516 Expert Mod 8TB
There's no need to use VBA to accomplish what you need. Just type the formula into the control source.
Jul 22 '11 #6
NeoPa
32,556 Expert Mod 16PB
An additional question was added here but had to be moved (Show Value with No Decimal Places) as we only allow a single question per thread.
Jul 23 '11 #7

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

Similar topics

11
by: TD | last post by:
I'm looking for input into my decision to switch to ADO and unbound forms. I get tired of having to block all of the ways a user can unknowingly save a record, like using the PageUp, PageDown keys...
6
by: Dave G | last post by:
I am writing a function to fill in the data in an unbound form. I have a table with field names of 1, 2, 3 etc up to approx 100. I have an unbound form with fields called 1, 2 3 etc. I gave...
6
by: ckpoll2 | last post by:
Hi, I have made a report that has a query as its record source. I put a text box in there that I want to run a dsum function off of a different query. The criteria that I need to use is that it...
3
by: technocraze | last post by:
Hi community experts, I am having an isue with Dsum function that is used to count the total number for a particular field (intake) at the textbox afterupdate event with condition/ criteria...
1
by: zaiena | last post by:
hello, i'm having this problem when try to display the total amount form subform to form,for example i'm having two tables one for the products which contains(p_no,p_name,price),and the other table...
9
by: BlackJack17 | last post by:
Alright you all have been so helpful with everything else that I thought I'd run one more issue by you. I have put together a report that is driven by a query. This query (Unique Records) returns...
6
by: Volker Neurath | last post by:
Hi all, I have a Problem with combobox-property "NotInList" and an unbound Form. The situation: On my main form i have three comboboxes for data-exchange (here: Names of distributor,...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
4
by: wassimdaccache | last post by:
dears I have a continuous forms. It contains 2 fields I made another field to check their accounts. it is . the source of is based on a DSUM function. "it is working well" Now I want to...
2
by: Gulnarambi | last post by:
I have a form in datasheet view with Total and Currency text boxes, in Currency text box I only can enter values of AZN and USD. Form is based on Table and as criterias information fromUnbound...
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
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: 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:
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
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.