qurey to listbox help

J

john coon

Hi group,

I'm looking for help getting a query to populate a listbox. My table is elec
and I'm trying to fill a list box from a field called signtype
where the value I'm looking for is "new rdr sign" I want to display the
name "new rdr sign" for each idea returned form the query.
In the end I am going to label the items from the list.

I'm in autocad 2002 linked toaccess bd by below
Private Sub CommandButton3_Click()
ListBox1.Clear
If UserForm1.Textbox1 = vbNullString Then
MsgBox "No Database Selected, Please Selected a Database"
End If
Dim wksObj As Workspace
Dim dbsObj As Database
Dim tblObj As TableDef
Dim fldObj As Field
Dim rstObj As Recordset
Dim reccount As Integer
Set wksObj = DBEngine.Workspaces(0)
Dim strDIMTXSTY As String
strDIMTXSTY = ThisDrawing.ActiveTextStyle.Height

On Error Resume Next
Set dbsObj = DBEngine.Workspaces(0).OpenDatabase(Textbox1.Text)
Set rstObj = dbsObj.OpenRecordset("elec", dbOpenTable)
Dim SQLString As String

rstObj.MoveFirst
Do Until rstObj.EOF

SQLString = "SELECT * from elec WHERE signtype = 'NEW RDR SIGN'"
ListBox1.AddItem SQLString
rstObj.MoveNext
Loop

End Sub

Thank you
John Coon
 
J

John Coon

Karl,

What value should I enter?
I get an error when I enter something
Thanks for your help.
John Coon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top