List Only

How to set list box in Access properly by coding?

I have a list box that contain some data on a form. My list box always come back Null even though there are data in it. How do I make it to "acknowledge" that it's not Null, codewise? Thanks!

Public Comments

  1. if(string != null) are you calling the right methods? listBox1.Text -> will give you input listBox1.index -> will get or set the index of the list
  2. Has something been selected in the list-box ?? At what point are you trying to use the list-box selection?? If you are trying to use the list-box before anything has been selected, then it will have a NULL value. The following code will allow you to test this out: Private Sub List01_AfterUpdate() MsgBox "Here is the selected item: " & List01.Value End Sub Each time you select something, a message should pop-up.
Powered by Yahoo! Answers