473,667 Members | 2,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checking for nulls and red-flagging your problems

153 New Member
Since people have been so helpful on this site I thought I'd contribute what little I can...since I am not a programmer but I'm working on an access database for work

The following code is an example of creating a variable Chk to which you assign a numeric value if a certain value is missing. If a certain field in a row is empty, then the chk number will return a value of 0-6. You can then arrange the chk number in ascending order so that any rows with missing values will show up at the top of your list and each number will correspond to a certain problem. If there are two numbers that are missing this will not work perfectly but at least all your problems will show up at the top of the list. You just insert this code into a field section of an append query. And have it insert into Chk or whatever you want to call it of some table for which you are designing the append query.

[PHP]Chk: IIf(IsNull([LastName]),0,IIf(IsNull([FirstName]),1,IIf(IsNull([AssetNumber]),2,IIf(IsNull([ProjectCodeList]),3,IIf(IsNull([ProjectCodeList 2]),4,IIf(IsNull([ProjectCodeList 3]),5,6))))))[/PHP]
Nov 3 '06 #1
1 1193
PEB
1,418 Recognized Expert Top Contributor
The problem with this method is that you see the first fault in your field... Not all!

It's possible to use the fiunction Switch as more simple as syntax but the result will be different coz it will return the last wrong field

Take care about the way how you do the check!

:)
Nov 4 '06 #2

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

Similar topics

3
1486
by: JackO | last post by:
I have a text box on a form “txtExamDate” that I know contains nothing. I am trying to test code that will determine the text box is nothing. I am getting the error because there is no value in the field and I am assigning it to a date field. My question is: How do I get the If statement to work? Exception Details: System.FormatException: String was not recognized as a valid DateTime Line 723: If TypeOf...
0
1578
by: Rhino | last post by:
I am working with SQL Functions in DB2 for Windows/Linux/UNIX (V8.2.1) and am having a problem setting input parameters for SQL Functions to null in the Development Center. My simple function, called Half, has a single integer input parameter and divides this value by two to produce its result. It also tests the input parameter to see if it is null; if it is null, it returns null. When I click the Run button and try to use the SET TO...
1
2068
by: PST | last post by:
Here's a problem I'm trying to deal with: I'm working on a Frontpage 2000 website for a boat handicapping system, built in Access 97. What I'm trying to accomplish is: The user enters a boat name in a text field OR a sail number in a text field, and gets the desired boat record back (an exact match).
4
2553
by: Rich | last post by:
I have a access form that is connected to linked sql table via odbc. I have some fields that I dont want to allow nulls when data is entered via the form. I can set the null checking on the SQL server database but the ODBC error tha tis returned is not very polite to the user since it mentions the sql field not the nice label. Is there a way for me to modify this error or put the check in access?
2
3402
by: Chris | last post by:
Hi, I have an SQL Query that loads a SQLDataReader object. The returned record has bit datatype columns that I use to provide true/false values. I can't get a definite answer googling on how to test if this field is null. I get casting errors, and can't check for null on a null data value errors
5
1786
by: Andy G | last post by:
I'm getting this error...Operator is not valid for type 'DBNull' and string "". What is happening is that I'm calling a stored procedure to use the email address to recover a forgotten username. If the email does not exist then I get the above error. After I execute the stored procedure I try and apparenty this is not catching the error. Should I use a Try...Catch? What is the correct way to check for nulls in ASP.NET? If Not...
3
1243
by: Brett Romero | last post by:
What is a better way for checking nulls than using the "==" operator? For example, .Equals() is better than == for most operations since it knows the type being checked. However, it doesn't seem to work for nulls. For example: object myobject = new object(); myobject = null; if (myobject.Equals(null)) Debug.WriteLine("no go");
66
3608
by: Johan Tibell | last post by:
I've written a piece of code that uses sockets a lot (I know that sockets aren't portable C, this is not a question about sockets per se). Much of my code ended up looking like this: if (function(socket, args) == -1) { perror("function"); exit(EXIT_FAILURE); } I feel that the ifs destroy the readability of my code. Would it be
2
1665
by: oaklander | last post by:
I currently have two String variables I check to find if they are duplicates: String str1 = "red"; String str2 = "yellow"; if (str1.equals(str2)){ System.out.println("Duplicate"); } else{ System.out.println("Not duplicate");
0
955
by: ricardovillarroel | last post by:
i am trying to check the text box for nulls once the user tabs over the text box. i do not want it to check for nulls when i click on okay. here is code. do i need to setfocus so it will go back to the text box? Private Sub txtArrivalDate_AfterUpdate() Dim ArrivalDate As Date ArrivalDate = txtArrivalDate.Value If IsNull(ArrivalDate) Then MsgBox ("Please enter a valid date.")
0
8459
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8889
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
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
8570
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
4202
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2781
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
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
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.