Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recordset woes

Status
Not open for further replies.
Aug 1, 2003
85
US
Help!!! I'm trying to populate a drop down list with the output from recordset2 and dynamically limit the data in recordset 2 with recordset1.

What I'm trying to accomplish is.
recordset1 = pagelinks that also = userid 1
recordset2 does not equal userid 1 and does not equal pagelinks from recordset1

Recordset1
SELECT useraccess.UserID, useraccess.Username, linkdetail.pagelinkIDdetail, pagelinks.pagelinks

FROM useraccess INNER JOIN (pagelinks INNER JOIN linkdetail ON pagelinks.pagelinkID = linkdetail.pagelinkIDdetail) ON useraccess.UserID = linkdetail.userID

WHERE useraccess.UserID=MMColParam

Recordset2
SELECT useraccess.UserID, useraccess.Username, linkdetail.pagelinkIDdetail, pagelinks.pagelinks

FROM useraccess INNER JOIN (pagelinks INNER JOIN linkdetail ON pagelinks.pagelinkID = linkdetail.pagelinkIDdetail) ON useraccess.UserID = linkdetail.userID

WHERE useraccess.UserID<>MMColParam and linkdetail.pagelinkiddetail<>MMColParamm


<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "1"
If (Request.QueryString("UserID") <> "") Then
Recordset2__MMColParam = Request.QueryString("UserID")
End If
%>
<%
Dim duplicate
duplicate = "(Recordset1.Fields.Item("pagelinks").Value)"
Dim Recordset2__MMColParamm
Recordset2__MMColParamm = "1"
If (Request.QueryString("UserID") <> "") Then
Recordset2__MMColParamm = ("duplicate ")
End If
%>

I thought maybe declare the variable and use that but I can't get the code to work. There is also a problem that the pagelinks field in recordset1 has several lines so does that mean I need to create an array and use that variable for mmcolparamm??

Not sure If I can get this done through the relationship or if I need to rethink the code.

Thanks,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top