Forums

ASP

This topic is locked

Recordset in a Recordset

Posted 20 Jul 2003 10:29:54
1
has voted
20 Jul 2003 10:29:54 Herra Jón posted:
Hi there

Gott a little problem here.

I would like to use the resaults from one recordset(expr1000) to filter another one on the same page.

Probably stupid but im stuck

thx in adnvance.

Replies

Replied 21 Jul 2003 12:00:57
21 Jul 2003 12:00:57 Vince Baker replied:
First creat a recordset.

Then, create the second one that is to be filtered on a value from the first. Make sure you do not create these in the wrong order....

Lets call them rsYourRS1 and rsYourRS2


the second should look like this in the advanced recordset window:

Select *
from yourtablename
where YourFilteredField = varField

Now, define the variable varField as:

Name: varField
default value: whateveryouwant
Runtime value: rsYourRS1.fields.item("FilteredFieldName".value

and there you go, second one filtered on a value from the first one.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic