How to convert recordset of only PKs into full field recordset?

B

Bam Bam

Hi all,

I have generated a multi-row recordset who's only field
contains CandidateIDs (a sub set of the full list in the Candidates
table).

e.g

450
459
468
482
504
511

Now I want to make a new recordset (or query) with the same number of rows
but with all the
fields for each record as in the Candidates table. Anyone know how?

Regards,

Bam Bam
 
V

Van T. Dinh

You can traverse the Recordset to construct a comma-separated list strList
of required CandidateID values like

450, 459, 468, 482, 504, 511

Then you can construct the SQL String required for the second Record using
something like:

strSQL = "SELECT * FROM tblCandidate AS C " & _
" WHERE C.CandidateID In (" & strList & ")"
 
B

Bam Bam

Thankyou so much for your replies, they both look like they will do the
trick

But, how so you save a recordset as a query?
 
Top