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

combobox - Error 94 Invalid use of Null

Status
Not open for further replies.

morechocolate

Technical User
Apr 5, 2001
225
US
I am taking a date field and parsing it out by month, day, and year and then trying to put those separate values into comboboxes.

However, I am getting error 94 Invalid use of Null. What follows is one of the many things I have tried to do.

varCMonth = IIf(IsNull(Month(rsObj!Close_Date)), Null, Month(rsObj!Close_Date))

Any suggestions are appreciated.

Thanks
 
Maybe this?

Code:
Do until rsObj.EOF
     If Not IsNull(Month(rsObj!Close_Date)) Then     
          ComboBoxMonth.AddItem Month(rsObj!Close_Date)
          rsObj.MoveNext
     End If
Loop
 
Sypeher,

Thanks for your response. I should have been a little clearer about what I am doing. It was late and I was tired.
So I will give it another try.

I already have the comboboxes poputlated. What I am doing is displaying the information based on a search criteria. In the case I mentioned above the record has been found, but when I go to display the null record I get the error I had mentioned.

I basically either want the text box portion of the combobox to stay blank or at least default it to the current month.

Thanks again for your help.
 
Don't know if this helps, but I had a similiar problem...and it was because the combo box was tied to a database that didn't allow nulls in that field.

--Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top