Sorry I didn't finish typing in previous post:
You need to maintain a string or a list or something as you go do checking for a tie.
If at any time a Tie is broken by another box, you need to reset the string.
Its more code...
to check and display results you can do this :
dim chkWinner as new checkbox
dim WinnerMessage as String
dim bTie as boolean
bTie = false
if Val(checkbox1.tag) < Val(checkbox2.tag) then
WinnerMessage = checkbox2.text
chkWinner = checkbox2
bTie = false
elseif( Val(checkbox1.tag) = Val(checkbox2.tag) ) then
WinnerMessage += "," + checkbox1.text
chkWinner = checkbox1
bTie = true
else
WinnerMessage = checkbox1.text
chkWinner = checkbox1
bTie = false
end if
if Val(chkWinner.tag) < Val(checkbox3.tag) then
WinnerMessage = checkbox3.text
chkWinner = checkbox3
bTie = false
elseif Val(chkWinner.tag)= Val(checkbox3.tag) then
WinnerMessage += "," + checkbox3.text
bTie = true
end if
if Val(chkWinner.tag) < Val(checkbox4.tag) then
WinnerMessage = checkbox4.text
chkWinner = checkbox4
bTie=false
elseif Val(chkWinner.tag) = Val(checkbox4.tag) then
WinnerMessage += "," + checkbox4.text
bTie = true
end if
[... and so on]
if bTie = false then
msgbox("the winner is : " & chkWinner.text & " with " & chkWinner.tag & " votes")
else
msgbox("We have a tie between : " & WinnerMessage & " with " & chkWinner.tag & " votes")
end if