|
-
Nov 3rd, 2000, 09:16 PM
#1
Thread Starter
New Member
could someone teach me how to load a list box with a Sql Statement. thanks
-
Nov 4th, 2000, 12:13 AM
#2
Lively Member
Hi
Assuming you wish to use a standard list box, not a DBList box control. See below.
Dim rcsBookDefine as recordset
Dim SQLStatement as string
lstFaultType.clear
SQLStatement = "Select * from [Fault Codes] order by [Fault Code Number]"
Set rcsBookDefine = MainDB.OpenRecordset(SQLStatement)
With rcsBookDefine
If .RecordCount > 0 Then
.MoveLast: .MoveFirst
Do While Not .EOF
lstFaultType.AddItem ![Fault Code Description]
.MoveNext
Loop
End If
.Close
End With
Hope this is of assistance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|