Re: VB Listbox?



"Mitchel" <Stratlake@xxxxxxxxx> wrote in message news:58041163-862c-4f47-95c9-2b2b1a5fa8e6@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Mar 11, 12:31 am, "Bob Butler" <no...@xxxxxxxxxxx> wrote:
"Mitchel" <Stratl...@xxxxxxxxx> wrote in message

news:9c73fbbb-454f-4783-9b13-6946836d358b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

> I have created an Access DB Query( Client names) and have a VB6 Form
> frontend. I need to create a search using a Textbox and Listbox, where
> I type into the Textbox and the results from the query are returned in
> the listbox. How do I do this??
> 22 minutes ago

What part are you having trouble with?
opening the database?
running the query?
loading the listbox?
15 minutes from now

Yeh I just dont know what code to use?
I've created an ADO and connected it to the query, but i dont know how
to populate the list?

"created an ADO"? Do you mean an ADO data control? Connected to the query how?

I just need a good front end that I can search the database by
firstname, lastname of ID(autonumber).

You probably need to post some code of what you have tried already. Your code should look something like

dim DB as adodb.connection
dim RS as adodb.recordset
set db=new connection
db.open "whatever the connection string is for your database"
set rs=db.execute("select thefield from thetable where thefield like '%" & _
replace(text1.text,"'","''") & "'")
list1.clear
do until rs.eof
list1.additem "" & rs.fields("thefield").value
rs.movenext
loop
rs.close
db.close


.



Relevant Pages

  • RE: ODBC query in VB code Need HELP
    ... terms of connection settings and object creation / disposal. ... Since your pass-through query already exists (including the ... Dim STRSQL As String ...
    (microsoft.public.access.formscoding)
  • RE: ODBC query in VB code Need HELP
    ... terms of connection settings and object creation / disposal. ... Since your pass-through query already exists (including the ... Dim STRSQL As String ...
    (microsoft.public.access.formscoding)
  • Re: ACC 2002: Sort a ListBox with no SQL rowsource
    ... then sort the array. ... >algorythm to sort my listbox where my listbox does not ... >have a SQL statement or Query for it's RowSource; ... >>Dim vGetWidths As Variant ...
    (microsoft.public.access.formscoding)
  • Re: Dynamic Query, Using ListBox and VBA
    ... Using a Microsoft Access Listbox to pass criteria to a query ... Dim MyDB As DAO.Database ... Dim strWhere As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Dynamic Query, Using ListBox and VBA
    ... Using a Microsoft Access Listbox to pass criteria to a query ... Dim MyDB As DAO.Database ... Dim strSQL As String ...
    (microsoft.public.access.modulesdaovba)

Loading