Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record not selected in list box 1

Status
Not open for further replies.

awhitsel

Programmer
Feb 22, 2001
80
US
How do I determine that an item has not been selected in a list box?

I want to be able to send out an error message to a user who does not select the record to be deleted from a specific list box.
 
I assume the user is clicking a button to issue a delete command that looks at the list and sees if it has any values to be deleted. If this is the case then you can use OnClick event of you command button to check the box before the delete command is issued like so:

[tt]
If MyListBoxName.ItemsSelected.Count < 1 Then
MsgBox &quot;No records selected to delete!&quot;
MyListBoxName.SetFocus
Exit Sub
End If
[/tt]


HTH
Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top