FinnMann
Try using this subroutine:-
Sub DAO_SQL_Search()
Dim db As Database
Dim rst As Recordset
Dim strSQL As String
' Open the database
Set db = DBEngine.OpenDatabase("c:\program files\microsoft office\office\samples\NorthWind.mdb"
'In the line below replace "sales" with a reference to the text box you want to search by (i.e. text1.text)
strSQL = "SELECT ContactName, ContactTitle FROM Customers WHERE ContactTitle like '" & "sales" & "*'"
' Open the Recordset
Set rst = db.OpenRecordset(strSQL, dbOpenForwardOnly, dbReadOnly)
' Print the values
Do Until rst.EOF
MsgBox "Contact Name is: " & rst!ContactName & vbCr & "Contact Title is: " & rst!ContactTitle
rst.MoveNext
Loop
' Close the recordset
rst.Close
MsgBox "finished"
End ' terminate program
End Sub
Basically, what it does is search through the Customers table in Northwind and finds anyone with a job title that begins with sales. Obviously, you will need to customise this. Any problems let me know.
Good luck!
DC