Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing Listbox.Value = Null 1

Status
Not open for further replies.

f64

Technical User
May 23, 2003
24
US
On a multipage userform, I would like to verify that a selection has been made in a listbox when the form is advanced to the next page.

If ListBox.Value = Null Then
Statement1
End If

When reaching this statement during debugging, ListBox.Value is shown = Null, but the statement isn't evaluated as true, and Statement1 is not executed. Is Null not a valid condition to test against in an If statement?

 
Replace this:
If ListBox.Value = Null Then
By this:
If IsNull(ListBox.Value) Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks I was stuck on this too. See, a search is often better than asking the same question twice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top