Apr 19th, 2000, 09:24 AM
I have searched a recordset using a text box and search criteria. It succesfully lists the matching feild values from the recordset into a list box. Then I want to select one of the field values from the listbox and set a global variable gstrCompanySelected to the field value then use that varable in a select statement after a like operator to set a grstCurrentRS object variable
Set grstCurrentRS = gdbCurrent.OpenRecordset("Select * from tblCustomers where fldCompanyName like " & "'" & gstrCompanySelected & "'")
the varaible gstrCompanySelected was set via a listbox in the form frmFind
MS_OS.gstrCompanySelected = lstSelected
lstSelected is the list box containing the field values from a recordset search
So after opening a database and searching a specific field using a textbox as search Input it lists all matches in the list box.. so far so good but I have tried several versions of the above code without luck.
Set grstCurrentRS = gdbCurrent.OpenRecordset("Select * from tblCustomers where fldCompanyName like " & "'" & gstrCompanySelected & "'")
the varaible gstrCompanySelected was set via a listbox in the form frmFind
MS_OS.gstrCompanySelected = lstSelected
lstSelected is the list box containing the field values from a recordset search
So after opening a database and searching a specific field using a textbox as search Input it lists all matches in the list box.. so far so good but I have tried several versions of the above code without luck.