Not a Member Yet,
Click here to Register

ID: 305
Viewed: 2993
Added: Aug 19, 2002
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo

User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

filling listbox.
adosekond is the recordset.
strsqllist is the sql statement used to populate the list.
category is the field from the recordset that is added to the list.

Highlight all by clicking in box

Highlight All
Private Sub fill_list() 

strsqllist = "select * from vbcode"
adosekond.Open strsqllist, db, adOpenStatic, adLockOptimistic
If adosekond.BOF = True Then
Exit Sub
End If
List1.AddItem "All Records"
For a = 1 To adosekond.RecordCount
If adosekond.EOF = True Then
Exit For
End If
List1.AddItem (adosekond("category"))

End Sub

**********To see when someone selects from the list above****

Private Sub List1_Click()

Dim a As String

a = List1.Text
If List1.ListIndex = 0 Then
strsql = "select * from vbcode order by category"
Else: strsql = "select
from vbcode where category = '" & a & "' Order by category"

End If
Call query_data
End Sub;

No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.

Replying to a Comment...

Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2024 All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!