Unanswered: Comparing Contents of a List Box with a Combo Box
I am using Access 97, and I'm trying to compare a single value of a list box (list01) to a single value of a combobox (combo01). The list box is made up of one single value and is shown as the result of an SQL statement in the code builder. The combo box has a few options that are generated by a query and the RowSource property takes in that query. I am using the following statement to try to compare the value of the list box to the value of the combo box with a simple error message if the expression is true:
If (Me!list01.Value = Me!combo01.Value) Then
MsgBox "Error Message!"
However, the result is always turning up false because list01.Value is returning a Null value when the combo01.Value is actually returning the selected value. Both fields contain text values, but I don't know what property to use for the list box to compare the value of it to the value of the combo box. Obviously Value seems to be the wrong one to use, so I tried RowSource among a few other things. Nothing worked yet. Any help someone can provide would be greatly appreciated!
I tried what you suggested, but that didn't work. The Me.list0 value was still showing as a "Null" value, while the Me.Combo0.Value was returning a real value such as "Work." Thus, the If statement is comparing "Work" to "Null" and that will result as false everytime. Do you have any other suggestions? Thanks for trying....appreciate it.