Show a list of all orders placed by the current customer on the Order Edit page.
Insert ASP code snippet on the Page Designer screen:
dim rstmp, CustomerID, rsOrders
set rstmp = dal.Table("orders").Query("OrderID=" &
request.querystring("editid1"),"")
CustomerID = rstmp("CustomerID")
rstmp.Close : set rstmp = nothing
response.write "Orders placed by " & customerid & "<br>"
set rsOrders = dal.Table("orders").Query("customerid='" & customerid & "'","")
do while not rsOrders.eof
response.write "<a target=_blank href=Orders_edit.asp?editid=" &_
rsOrders("OrderID") & ">" & rsOrders("OrderID") & "</a> " &
rsOrders("OrderDate") & "<br>"
rsOrders.MoveNext
loop
rsOrders.Close : set rsOrders = nothing
See also:
•QueryResult object fetchAssoc()
•Master-details relationship between tables