This topic is locked

Reference Child Records

5/5/2009 8:48:12 AM
ASPRunnerPro General questions
N
NigelEtienne author

Hi

I am using ASPRunnerPro build 766.

On table1 I have used the "table link" properties to link to table2 and table3.

I only want the table link to table3 to be displayed if the child count of table2 = 100
Can this be done, if so can you supply some sample code?
Many thanks in advance

J
Jane 5/5/2009

Hi,
use List page: After record processed event for this purpose.

Here is a sample:

str = "select count(*) from table2 where key=" & data("FieldName")

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
if rstmp(0)>100 then

xt.assign "table3_dtable_link", true

else

xt.assign "table3_dtable_link", false

end if
rstmp.close

set rstmp=nothing

N
NigelEtienne author 5/7/2009

Hi,

use List page: After record processed event for this purpose.

Here is a sample:


Hi As suggested I have added the code above to

' List page: After record processed

Sub BeforeMoveNextList(rs,row,col)
The rstmp(0) test is working (I added a response.write statement to return the value of rstmp(0))

BUT the tablelinks are both still visable on table1 when rstmp(0) = 100

Sergey Kornilov admin 5/7/2009

Try this:

str = "select count(*) from table2 where key=" & data("FieldName")

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
if CInt(rstmp(0))=100 then

xt.assign "table3_dtable_link", true

else

xt.assign "table3_dtable_link", false

end if
rstmp.close

set rstmp=nothing
N
NigelEtienne author 5/8/2009

Try this:


str = "select count(*) from table2 where key=" & data("FieldName")

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
if CInt(rstmp(0))=100 then

xt.assign "table3_dtable_link", true

else

xt.assign "table3_dtable_link", false

end if
rstmp.close

set rstmp=nothing


Hi, I have added theadditional code but still both links show.
Here is my code:

Sub BeforeMoveNextList(rs,row,col)

'

str = "Select count(*) from qryMyOrders where UserID=" & session("UserID")

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection

'

if CInt(rstmp(0))=100 then

xt.assign "Create_Order_dtable_link", true

response.write "You have " & rstmp(0) & " orders in the system"

else

xt.assign "Create_Order_dtable_link", false

response.write "You have " & rstmp(0) & " orders in the system"

end if

rstmp.close

set rstmp=nothing

'

End Sub ' BeforeMoveNextList

J
Jane 5/8/2009

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.