
February 6th, 2004, 10:05 PM
|
|
Registered User
|
|
Join Date: Oct 2003
Posts: 17
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Determine if recordset has been set
Hi:
I am a bit of a newbie at what I am requesting but if you can help, I would appreciate it.
I have a database at work which lists publications. Publications can have multiple authors so in the Pub_author table, there is a PubID field and AuthorID fields - when there are multiple authors, the PubID appears as many times as there are authors. I have created a search form which works in all other respects (year, publication type, etc) but I am having a bit of trouble with authors and I understand what the problem is, just having difficulty implementing the solution.
If I am searching for any publications written by both Tom and Joe, I realize that I have to do multiple passes. So, I search for all publications written by Tom and dump the results into a recordset. I then search the recordset for publications written by Joe and therefore, I get all publications written by both. However, my problem is this: if I do a loop, the first time it goes through the loop, it creates the recordset from the table data and for each subsequent loop, it searches not the original tables but the recordset. I have to check that the recordset has been set on the first pass (ie, if not set, then dump results into new recordset, else, query recordset). I tried isNull(recordset) but VB tells me that the recordset has not been set. There is no test in Access 97 called IsSet(recordset) but that is essentially what I want.
Any ideas?
Jules
|