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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid value null

Status
Not open for further replies.

detdu

Technical User
May 23, 2003
36
SE
hi.. i wanted to ask how to get my combo box to accept a nul value... it filters the report is i choose something in my combo box.. but as soon as i choose a null value it wont accept it.. i want it to accept the null value and present the report without filtering it... any ideas?
 
Nulls are not to be bandied about and will do things that you cannot foreknow. Instead set the combo with a null striing ( "" ) and you will maintain more control. A Null plus anything is Null and a Null times anything is a Null and a Null on the right hand side of an equation you have already seen.

Rollie@bwsys.net
 
okej i understand what you are saying... but since im pretty new at this i really dont know how... could u give me one simple code example?

thanks
 
why would you want a combo box to accept a null value and what code do you want to see?

rollie@bwsys.net
 
what i meant was... if i want to leave a combo box blank.. what can i do to make it to accept it.. cause i have three combo boxes.. and its not meant to be that you have to choose something from all of them
 
Nz converts a null to a zero-length string. The code below is put into your combobox's on enter event procedure. Try this:

Code:
Private Sub YourComboBox_Enter()
Val (Nz([YourComboBox], ""))
End Sub

Judge Hopkins


There are only two rules for success: (1) Never tell everything you know.
 
a combo box is usually used to put and entry into another control. To leave it blank is not at all a usual desire. Think of it as a store room from which you take entries. Then just do not take an entry.

rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top