ok.
so - i think we are making this all too complicated for you!
it is so simple when using bound text boxes and the data control.
Assuming your data control is called Data1
Code:
'Run the search.
Data1.RecordSource = "(" & SQLQuery & ")"
Data1.Refresh
That will load the recordset into the data control automatically.
You shouldnt need to worry about any of the lines of code like:
set rs = whatever, or set db = whatever.
To move between found records, just use this:
Code:
Data1.moveFirst/moveNext/MovePrevious/MoveLast etc...
To bring back all the records in the database, so that you can search again, you will need to refresh the data control with an sql query that loads all records again:
Code:
Data1.recordsource = ("SELECT * FROM table1")
Data1.refresh
Just remember, that after every sql query, you have to refresh the data control.