473,508 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can this code be fixed

20 New Member
Is there a way to fix this code so it stops returning the value of $11.00 when $0.00 is entered. Thanks in advance. You all have been great

Expand|Select|Wrap|Line Numbers
  1.    If "" & Me!Number_of_Pages_in_Doc_1 < 0 > "" Then
  2.    Me!Total_Costs_1 = Me!Number_of_Pages_in_Doc_1 * 3 + 11 
Jan 5 '10 #1
5 1149
missinglinq
3,532 Recognized Expert Specialist
Your code isn't at all clear to me, but I think this is what you're trying to do:
Expand|Select|Wrap|Line Numbers
  1. If Nz(Me!Number_of_Pages_in_Doc_1, 0)  > 0 Then
  2.     Me!Total_Costs_1 = Me!Number_of_Pages_in_Doc_1 * 3 + 11 
  3. End If
If Me!Number_of_Pages_in_Doc_1 is empty (Null) then Nz() converts it to Zero, and if it is then > 0 it runs your calculation.

If you need it to return a value if it is now Zero, like $0.00, use an Else clause to to that.

Linq ;0)>
Jan 5 '10 #2
joeldault
20 New Member
Thanks for your responce, That sis not work. It still Returns the Value of 11.00 I has something to do with the 11 after then then, If I take ot out. I get 0.00 or 0 pages
Jan 5 '10 #3
joeldault
20 New Member
I have Typed Rhis is the Controll source and it still returns the value of $11.00 When 0 is Typed
=Nz(11+3*[Number_of_Pages_in_Doc_1],0)

I need have the first page of a document cost 14.00 and easch addition page costs $3.00. I am entering in a field on a form the # of pages and I need to get a total
Jan 5 '10 #4
missinglinq
3,532 Recognized Expert Specialist
This will do what you ask:
Expand|Select|Wrap|Line Numbers
  1. =IIf(Nz([Number_of_Pages_in_Doc_1],0)>0,([Number_of_Pages_in_Doc_1]*3)+11,0)
If you'd given a clear description of what you were actually trying to accomplish this would have been answered in the first response.

And do not, I repeat do not, take code that you have been provided here, change it around completely, and then respond "That sis not work!"

All of these things waste the time of the volunteers here who are trying to help you!

Linq

Moderator
Jan 5 '10 #5
joeldault
20 New Member
Thanks, That Did it, I have one more questions I will Post and then I hope I am done, Thanks
Jan 5 '10 #6

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

Similar topics

26
9635
by: Adrian Parker | last post by:
I'm using the code below in my project. When I print all of these fixed length string variables, one per line, they strings in questions do not properly pad with 0s. strQuantity prints as " ...
1
3513
by: Jaz | last post by:
Trying to use a fixed layer for a couple of NAV buttons. I found this code, but the IE part is commented, and I don't understand the IF statement. It works great on Moz/Firebird and Opera BUT...
17
3347
by: HALLES | last post by:
HELLO ! I seek to use a form too fill a file without putting a server on my computer. I am no C# programmer, i can do some things in Javascript but IT CAN T WRITE REWRITE APPEND A FILE ON LOCAL...
9
4166
by: pout | last post by:
What are the purposes of fixed-point? When should it be used? I read: #define Int2Fixed(x) (((long)(short)x) << 16) and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to...
18
1480
by: joshc | last post by:
I've got two bits of code that I would like some more experienced folks to check for conformance to the Standard. I've tried my best to read the standard and search around and I think and hope this...
65
12509
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
10
1364
by: Michael | last post by:
Hi Everyone. I have been designing a form with about 100 or so controls and today I pasted some code from another test project into this one and then all the controls on the form disapeared from...
4
14776
by: jason.awlt | last post by:
Greetings, I recently being bugged by the following error on my DB2. SQL0902C SQLSTATE = 58005 Reason Code = 14 This error comes out everytime i tried to insert some record to a table...
1
10390
by: O.B. | last post by:
In the example below, I'm trying to convert a fixed byte array to a string. I get an error about needing to use "fixed" but I have no clue where to apply it. Help? using System; using...
2
3331
by: cwilber3249 | last post by:
I am tryign to make this code for a class i have and i can get it to compile and what not but it doesnt post the right change. Heres is my code, Please help. Its very basic and i think i am just...
0
7225
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
7123
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
7324
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
7382
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...
1
7042
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
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.