No you have 8 combinations. A label is either empty or not so it only have two states and you have 3 labels which gives 2^3 = 8 combinations.
If you don't care what the text in the labels read but only want to check if the Caption is empty or not you can convert these states into numbers from 0 to 7.
0 = All three labels are blank
1 = Label1 contains text, the others are empty.
2 = Label2 contains text, the others are empty.
3 = Label1 and Label2 contains text while Label3 is empty.
4 = Label3 contains text, the others are empty.
5 = Label3 and Label1 contains text while Label2 is empty.
6 = Label3 and Label2 contains text while Label1 is empty.
7 = All labels contains text.
You can easily get these numbers by saying that Label1 have the value 1 if it contains text, Label2 have the value 2, while Label3 have the value 4 (binary). If a label doesn't contain text it has the value 0.
Using the code above "value" will be something between 0 and 7. Now use a Select Case and do whatever.Code:Dim value As Integer value = IIf(Label1.Caption <> "", 1, 0) value = value + IIf(Label2.Caption <> "", 2, 0) value = value + IIf(Label3.Caption <> "", 4, 0)




Reply With Quote