
12-26-2004, 09:31 AM
|
|
Newcomer
|
|
Join Date: Nov 2004
Posts: 13
|
|
Quote:
|
Originally Posted by jkserial
What I am doing is using a query to get specific data from the db and then have the first and last names (each are seperate fields in db) display in the list box. I do not know how to go about doing this, please help?
|
I assume you got RC as your recordset variable ( ADO Version )
Code:
Function GET_REC(ByVal Table_Name$,ByVal s_Criteria$,ByVal sIndx$)
RC.Open "SELECT * FROM [" & Table_Name & "] WHERE [" & sIndx & "]='" & s_Criteria & "'"
If Not RC.EOF Then '// we found the target
'// fill up the listbox
List1.Additem RC!First_Name & VbTab & RC!Last_Name
End If
Set RC = Nothing '// Nill
'//Using Code : GET_REC "Table1",txtSearch,"Primary Key Of Yours"
End Function
Happy coding, bye . . . 
|
Last edited by Zero Ice; 12-26-2004 at 09:41 AM.
|