Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 23rd, 2005, 12:19 PM
Friend of Wrox
Join Date: Apr 2004
Location: San Francisco, CA, USA.
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default Testing for NULL Values in a Combo Box

I have a combo box on a form which may sometimes have a null value in it. There is no way around that. It's complicated. Please just take my word for it.

Is there a way to test for a null value in it?

IsNull(me.ComboBox1.Value) isn't working. It's thowing an error, saying, "you entered an expression that has no value".



Reply With Quote
  #2 (permalink)  
Old September 23rd, 2005, 12:32 PM
Friend of Wrox
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post

do you have your combo box set to limit to list?


Reply With Quote
  #3 (permalink)  
Old September 28th, 2005, 09:37 AM
ru1 ru1 is offline
Authorized User
Join Date: Feb 2005
Location: Detroit, MI, USA.
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts

Ok bud. Here you go:

If isnull(me.ComboBox1.Column(0))

The column function will examine each item in your combo list. It is zero relative, but don't let that scare you. All that means is that the first item in your list starts at 0 and the second one will be 1 and so on.

Also, you can use the column function to set values you have dim or other values in your form. Example:

Dim strItem1 as String

strItem1 = Me.ComboBox1.Coulmn(0)
if isnull(strItem1) then

txtItem2 = Me.ComboBox1.Coulmn(1)
'Seeing that maybe txtItem2 is a test Box on your form.

I hope this helps out. Please let me know.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show all values in a combo box in a report Odeh Naber Access 3 July 24th, 2007 07:37 AM
values in combo box Vince_421 Access VBA 8 May 10th, 2007 08:46 AM
combo box saves Number of Values JpaulH Access VBA 2 May 3rd, 2006 06:55 AM
Combo box with different display and send values iniro VB.NET 2002/2003 Basics 3 November 9th, 2004 12:34 PM
Using values from a combo box as variables in SQL SoC Classic ASP Basics 7 July 20th, 2004 03:29 AM

All times are GMT -4. The time now is 11:36 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.