Hi: Using SQL statements only to open a access database I have been able to load all fields in the recordset into a list box but I only included one field in the select statement. When you click on the cmdLookUp button it loads all 3 of the CompanyName field values in a list box this works:
Private Sub cmdLookUp_Click()
Dim pstrSQL As String
Dim prstCurrent As Recordset
Dim pfldCurrent As Field
Dim pstrLine As String
pstrSQL = "SELECT fldCompanyName FROM tblCustomers"
Set prstCurrent = MR_OS.gdbCurrent.OpenRecordset(pstrSQL)
Do Until prstCurrent.EOF
For Each pfldCurrent In prstCurrent.Fields
pstrLine = pfldCurrent
Next
lstCompanies.AddItem pstrLine
pstrLine = vbNullString
prstCurrent.MoveNext
Loop
End Sub

Now I am trying use a text box to enter search critera into ex: "*" and click the cmdLookUp button and it will show all of the fields in a specific field specified with a WHERE and
a LIKE ... It dont work here it is:

Private Sub cmdLookUp_Click()
Dim pstrSQL As String
Dim prstCurrent As Recordset
Dim pfldCurrent As Field
Dim pstrLine As String
'pstrSQL = "SELECT * FROM tblCustomers WHERE fldCompanyName LIKE & 'txtSelect'"
'pstrSQL = "SELECT * FROM tblCustomers WHERE fldCompanyName LIKE txtSelect"
'pstrSQL = "SELECT * FROM tblCustomers WHERE fldCompanyName LIKE 'txtSelect.Text'"
'pstrSQL = "SELECT * FROM tblCustomers WHERE fldCompanyName LIKE 'txtSelect'"
pstrSQL = "SELECT * FROM tblCustomers WHERE fldCompanyName LIKE '" & txtSelect.Text & "'"
Set prstCurrent = MR_OS.gdbCurrent.OpenRecordset(pstrSQL)
Do Until prstCurrent.EOF
For Each pfldCurrent In prstCurrent.Fields
pstrLine = pfldCurrent
Next
lstCompanies.AddItem pstrLine
pstrLine = vbNullString
prstCurrent.MoveNext
Loop
End Sub

The commented out pstrSQL lines (the entire SQL line should be commented out hope the format dosent mess it up) were
some of the ones Ive tried and none of them worked I tried alot of others also .

I want to be able to enter something into a text box ex: B*
click the look up button find all matching ones from the fldCompanyName and display the results in a listbox

plz help