View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kuzniaj kuzniaj is offline
external usenet poster
 
Posts: 1
Default Listbox data required


I am pretty new to this forum and have had most of my questions answere
by searching other threads. But can't find an answer on this one.

I have created a form for data entry and it has several list and tex
boxes. I have used an if then statement to validate that the tex
boxes have data in them at the time of execution. I would like to d
the same with the list box but the code does not work. The list box i
poplulated but no data is selected. When I press "OK" I would like fo
it to validate that data is selected / highlighted.

Private Sub cmdOK_Click()
If lboTeam.value = "" Then
MsgBox "You need to fill in your Team Name"
Exit Sub
End If

If txtPlayer.Value = "" Then
MsgBox "You need to fill in the Player's Name"
Exit Sub
End If

Any help would be greatly appreciated. Thanks

--
kuznia
-----------------------------------------------------------------------
kuzniaj's Profile: http://www.excelforum.com/member.php...fo&userid=3471
View this thread: http://www.excelforum.com/showthread.php?threadid=54479