Dynamic Repeat Region Table

Hi,

I have 2 recordsets Recordset1 & Recordset2

I am wanting to create a repeat region of the Recordset1 but also have a colum that is linked to Recordset2

Recordset1 is transaction details based on url=MemberID
Recordset2 is member details based on the column MemberID in Recordset1

when i try to do this, i get the first record in the database for Recordset2 column on all the listing in the table.

Can I make Recordset2 dependent on Value of Row for Recordset1?

Austin
USCBigRedAsked:
Who is Participating?
 
Jason C. LevineNo oneCommented:
Yes, most likely.  When you have two tables with related records, you need to structure the SQL with an INNER JOIN so that the related records are pulled up as part of the same recordset.  So let us say hypothetically you have a users table and a user_detail table where user_id is the linking field.  The correct SQL to pull everything up is:

SELECT users.field1, users.field2, users.field3, user_detail.field4, user_detail.field5, user_detail.field6
FROM users INNER JOIN user_detail ON users.user_id = user_detail.user_id;
0
 
Jason C. LevineNo oneCommented:
Hi Austin,

What you need to do is create ONE recordset that pulls in the relevant fields from both tables via a SQL Join for the repeat region or have the second recordset be on a different page and call it via a master/detail link.
0
 
USCBigRedAuthor Commented:
when, i join, it returns more rows than i want, i think it returns everything in the database.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Jason C. LevineNo oneCommented:
It's a little hard to help you write SQL without seeing at least the table structures in question...
0
 
USCBigRedAuthor Commented:
sorry about that, here you go...
can you figure it out from this...

<%
Dim Recordset1ALL
Dim Recordset1ALL_numRows

Set Recordset1ALL = Server.CreateObject("ADODB.Recordset")
Recordset1ALL.ActiveConnection = MM_inah_SQL_STRING
Recordset1ALL.Source = "SELECT *  FROM dbo.inah_member, dbo.inah_referral  WHERE referralbyMemberID = " + Replace(Recordset1ALL__MMColParam, "'", "''") + ""
Recordset1ALL.CursorType = 0
Recordset1ALL.CursorLocation = 2
Recordset1ALL.LockType = 1
Recordset1ALL.Open()

Recordset1ALL_numRows = 0
%>

do i need to make the SELECT Statement do something else?
0
 
USCBigRedAuthor Commented:
Thanks so much!!
0
 
Jason C. LevineNo oneCommented:
No problem.
0
 
USCBigRedAuthor Commented:
hey, i've posted another question, check it out!!
Austin
0
 
Jason C. LevineNo oneCommented:
Where?
0
 
USCBigRedAuthor Commented:
0
 
USCBigRedAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.