|
-
Feb 12th, 2001, 01:42 PM
#1
Thread Starter
Addicted Member
How do I display all true values from an access database boolean field in a DBListBox Control?
(SQL Statement please if possible...)
Thanks in advance...
-
Feb 12th, 2001, 03:59 PM
#2
PowerPoster
I assume you mean show records that have a boolean field in, which is true...?
Try this, it's a sample that includes the field CustomerID, CustomerName and IsBooyaka (the boolean)
Dim MyDB As Connection
MyDB = New Connection
Dim adoMyAdo As Recordset
Set adoMyAdo = New Recordset
With MyDB
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=C:\Mydb.mdb;Jet OLEDB atabase Password=mypassword;"
.Open
End With
adoMyAdo.Open "SELECT Customers.CustomerID, Customers.CustomerName FROM Customers WHERE Customers.IsBooyaka = True ORDER BY Customers.CustomerID;", MyDB, adOpenStatic, adLockOptimistic
Now set the properties of the Data List
Set DataList1.RowSource = adoMyAdo
DataList1.BoundColumn = "CustomerID"
DataList1.ListField = "CustomerName"
Listfield is the field you want shown in the listbox and bound column is the value returned by the listbox.
If that don't work there is probably something really obvious I made a typo on or something.
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
|