Not a Member Yet,
Click here to Register

ID: 305
Viewed: 3001
Added: Aug 19, 2002
Version:
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
<!---Declaration--->
none

Highlight All
<!---Code--->
Private Sub fill_list() 


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


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
authour,category,code,codeid,declarations,description,implementation,title
from vbcode where category = '" & a & "' Order by category"

End If
adoPrimaryRS.Close
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 snippetlibrary.com All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!