473,624 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formatting NULL values in Drop-Down control

I have a drop-down control that is being populated by an entire table
(not a query). There are NULL values in the table which appear as
blank spaces in the drop down. How can I format the drop down to put
some static text in place of the empty space. (For example
'Available', or 'Not Defined')

Mar 22 '07 #1
4 2193
On Mar 22, 1:20 pm, "jtertin" <jter...@gmail. comwrote:
I have a drop-down control that is being populated by an entire table
(not a query). There are NULL values in the table which appear as
blank spaces in the drop down. How can I format the drop down to put
some static text in place of the empty space. (For example
'Available', or 'Not Defined')

Use a query as the rowsource.

SELECT table.field1, table.field2, IIF(Nz([table].[field3],"")="","Not
Defined",[table].[field3]) AS FakeField FROM .....

Mar 22 '07 #2
On Mar 22, 12:36 pm, "storrboy" <storr...@sympa tico.cawrote:
On Mar 22, 1:20 pm, "jtertin" <jter...@gmail. comwrote:
I have a drop-down control that is being populated by an entire table
(not a query). There are NULL values in the table which appear as
blank spaces in the drop down. How can I format the drop down to put
some static text in place of the empty space. (For example
'Available', or 'Not Defined')

Use a query as the rowsource.

SELECT table.field1, table.field2, IIF(Nz([table].[field3],"")="","Not
Defined",[table].[field3]) AS FakeField FROM .....
For anyone else's future reference:

When I tried the above code, I was returned ONLY the null values as
"Not Defined", but none of the existing data.

I was unfamiliar with the "NZ" operator in access, and as it turns
out, that is all I needed to use. The final query was:

SELECT Table1.Field1,N z(Table1.FieldW ithSomeNulls,"N ot Defined") AS
FakeField

Mar 22 '07 #3

Sorry I misinterpreted about the other values.

Mar 22 '07 #4
On Mar 22, 2:32 pm, "storrboy" <storr...@sympa tico.cawrote:
Sorry I misinterpreted about the other values.
No, thank YOU for saving me a LOT of research time!

Mar 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
12532
by: manning_news | last post by:
Using SQL2000. According to Books Online, the avg aggregrate function ignores null values. ((3+3+3+3+Null)/5) predictably returns Null. Is there a function to ignore the Null entry, adjust the divisor, and return a value of 3? For example:((3+3+3+3)/4) after ignoring Null entry. If there's more than one null value, then adjust divisor accordingly. For example: ((5+5+5+4+Null+5+5+Null)/8) would be ((5+5+5+4+5+5)/6) after nulls...
1
3145
by: spshealy | last post by:
Greetings, I have a question about how nulls are handled in "IN" clauses.. I understand the operation null = anyvalue is undefined. Please examine the following example. drop table one DB20000I The SQL command completed successfully. create table one( first char(3), next1 int) in mcd_fl_coord3
7
1962
by: yoyo | last post by:
Is there any way to make a select in DB2 to output in the following manner: Attr1 value1 Attr2 value2 Attr3 value3 Attr4 value4 Instead of the Attr1 Attr2 Attr3 Attr4
1
3489
by: Baldur Norddahl | last post by:
Hi, I just noticed that I could do this: webshop=# create table foo (bar text not null primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo" CREATE TABLE webshop=# create table foo2 (bar text not null, foreign key (bar) references foo(bar) on update cascade on delete set null);
7
2207
by: teddysnips | last post by:
Table DDL below: The tables I have contain Timesheet information. Each row in the tblTSCollected table contains an entry for an employee into the timesheet system, specifically by scanning the barcode on their badge. A whole bunch of business logic periodically attempts to "pair" these into logically matched scans. For example, some employees will scan in and out of a single place of work. For these there will be a row written to...
1
7472
by: shearichard | last post by:
Hi - I have written some python to insert a row into a table using MySQLDB. I have never before written SQL/Python using embedded parameters in the SQL and I'm having some difficulties. Could someone point me in the right direction please ? The python looks like this : import MySQLdb import MySQLdb.cursors conn = MySQLdb.Connect(host='localhost', user='abc,passwd='def',
8
1693
by: alamb200 | last post by:
Hi I have set up a SQL database to contain alist FAQ's for our company and then plan to pull this info off using a web page. So far I have entered the data but I am unable to control how it is displayed inside SQL ie I cannot enter new blank lines I have tried using lots of spaces but this does not work when I use the website to display the info. Is there a way of formatting and editing the data in the sql database
6
3643
by: GAC | last post by:
I've used conditional formatting on ACCESS reports but have come up with a problem using it for a FIELD that has a value of either YES or blank/null. The default formatting (used when condition(s) are not met) is always used EVEN WHEN I specify Condition 1 to change the formatting when the field is YES. What am I missing....doesn't conditional formatting work on fields defined as TEXT with values of YES or Blank(Null)?
4
5596
by: qwedster | last post by:
Howdy folks! I am using stored procedure to see if a value exists in database table and return 0 if exists or else -1, in the following SQL queries. However how to check if a value (that is null) exists in database table and return 0 if exists or else -1 using stored procedure? Please help. USE GO IF EXISTS (SELECT name FROM sys.databases WHERE name = 'ExampleDatabase')
2
14648
by: qwedster | last post by:
Folk! How to programattically check if null value exists in database table (using stored procedure)? I know it's possble in the Query Analyzer (see last SQL query batch statements)? But how can I pass null value as parameter to the database stored procedure programattically using C#? Although I can check for empty column (the following code passes string.Empty as parameter but how to pass null value?), I cannot check for null value...
0
8177
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8629
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
8341
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
8488
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
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
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...
1
2611
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
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1488
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.