473,666 Members | 2,115 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 1159
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_Pa ges_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
9671
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 " 4". Six spaces than the value of intQuantity. This is correct. But all the others end up being string objects of only 6 characters long (with the exception of strTotal). The left most positions of the string object are being padded with one...
1
3523
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 not IE. Would someone please take a look at this and tell me if it can made to work in IE? If it can, a hint on the syntax/code would be much appreciated! PS, this would also get rid of my fixed background. Thanks in advance Jaz
17
3369
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 DRIVES . ANY ASP PIECE OF SCRIPT TO HELP AUTOMAT MY INPUTS USIGA FORM LIKE PROCESS ? Regards.
9
4184
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 integer or decimal part? For example, if in 8.24, should the macro be: #define Int2Fixed(x) (((long)(short)x) << 24)?
18
1500
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 code contains no cause for concern. /* taking absolute value of signed integer */ int32 val; uint32 abs_val; val = -492;
65
12570
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 method was a piece of C code which turned out to be incorrect and incomplete but by modifieing it would still be usuable. The first method was this piece of text:
10
1377
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 view. If I look at the Region " Windows Form Designer generated code" section I can see the code for the controls are there. Except for a few controls, like a tab control and some labels (these controls are highlighted with errors). Why would this...
4
14799
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 (consist of BLOB datatype) called BINSCHEMA.BINARYIMG. I use VB6 to do
1
10417
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 System.Collections.Generic; using System.Text; using System.Runtime.InteropServices;
2
3340
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 confusing myself. #include <iostream> #include <iomanip> #include <cmath> using namespace std; //Prices for items void priceAmount(float info) {
0
8449
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8784
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8556
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8642
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4371
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2774
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1777
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.