see thread705-503186 There are two routines posted therein. I believe that the one I posted (with some enhancement) will do the finding. You will note the critique. I believe that some of it is presented without really looking at the 'routine', but I will respond to parts of it.
1.[tab]I fully intended to do the complete search. I did miss
checkout's mention of the specific record. For your purpose, I believe that the procedure I posted is more appropiate.
2.[tab]I do not think this is relevant. Wheather the 'original' recordset is closed or not will have little effect on the overall process given the procedure's outline.
3.[tab]The actual construction of the clause in all but one of the 'cases' is commented out. They were not intended to be completed (at least not by me), but to show the type of operation which MIGHT be useful to the (other) users. Different processes MAY want to explicitly handle various field types in different manners. This is wht the comment reference to "DataTypeEnum" is included with the Select Case Statement). I totally miss his point re the "equal sign" at the bottom of this item.
4.[tab]Yes. This will open a new / seperate RECORDSET for each field. Restricted to the individual Record, it is un-necessary. For searching an Entire table, it is a way to find the appropiate records (those which DO include the value).
5.[tab]A small sloppiness=. The entire set of local variables will go out-of-scope at the conclusion of the procedure, so the array will not exist when the process is complete.
In other areas, your requirement is somewhat different, so additional items need to be considered.
A.[tab]The procedure relies on and expects to search a specific table in the CURRENT db. You would need to expand the procedure to Include the db path\name and open THAT db as an additional db to Search. An alternative could be to have a calling routine to open the db and pass the reference to the procedure.
B.[tab]The procedure ecpects to receieve a table name to search. This, like the db (see Item "A"

needs to be revised in some manner. If (in Item "A", you choose to open the db seperatly and pass the reference to this procedure, then passing the table name can reasonably remain as it is currently). If the procedure is modified to accept the db name and expects to open the db itself, there needs to be a mechanisim to determine which 'tables' to open (more on this later)
C.[tab]The procedure returns a string which is simply the field name. This is possibly inadequate, but depends on how you would resolve "A" & "B". In general, I would suggest that an entirely seperate procedure be generated to do the actual "posting" of the record to your results table. The (modified) procedure would pass the elements to the posting procedure. Presumably, this would include hte db (path & Name), the table and the field. In some manner, you will generally want to also be able to include the 'value'. You will want to assure that the recordset which holds the reclts of your search is either cleared of previous results or the records include an explicit indiciator of the search (value searched for and date/time of search?).
D.[tab]In the process of finding the tables within the db being searched, the taabledefs collection is not the approach I would recommend. Look into the MSysObjects (system) table. It includes ALL objects in the database and may easily be referenced in a query to select the tables and exclude the MSys* objects. This would provide a convenient "recordset" to loop through (replacing your itable = 0 to ... with a While Not rst.Eof type). The loop construct is not that important, but the process of looping through the collection as opposed to the simply query / recordset may be.
E.[tab]the porcedure I posted (ref Thread). Completly exits after a first match is found. From your commentary, you would want it to simply continue processing (skip to the next field / table).
I am sure that additional issues will intrude, but the referenced thrad and these comments should get you several steps closer.
MichaelRed
m.red@att.net
Searching for employment in all the wrong places