What you should do is:<BR><BR>Create a variable holding the value of objRS4("ordergroup_id") Then close the recordset objRS4 like this:<BR><BR>.<BR>.<BR>.<BR>Dim OrderGroupID<BR>OrderGroupID = objRS4("ordergroup_id")<BR><BR>objRS4.Close<BR>Set objRS4 = nothing<BR><BR>'Then create your *new* sql Query like this:<BR><BR>Dim strSQL5<BR>strSQL5 = "SELECT * " & _<BR> "FROM DistributionCodes " & _<BR> "WHERE ordergroup_id = " & Cint(OrderGroupID) & _<BR> " ORDER BY distribution_id, code_sequence ASC "<BR>'FOR DEBUG ONLY<BR>'Response.Write strSQL5 & "<hr>"<BR>'Response.End<BR><BR> 9;NOTE: if OrderGroupID is too long, use Clng() instead of Cint()<BR><BR>'Finally<BR><BR>set objRS5 = Server.CreateObject("ADODB.Recordset")<BR>objRS5.O pen strSQL5, objConn<BR>
I'm getting this msg now. <BR>Error Type:<BR>ADODB.Field (0x800A0BCD)<BR>Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.<BR><BR>the line that it occurs is :<BR>ordergroupid = objRS1("ordergroup_id")<BR><BR><BR>Thanks for the help.
In the previous example we had "objRS4" now you have "objRS1" is this a typo on your part or should I assume that "objRS4" is in fact "objRS1" ?<BR><BR>The error message means that objRS1("ordergroup_id")<BR>has NO DATA.<BR><BR>Before you create your "objRS1" object make a response.write of the SQL Query, then copy/paste it in QueryAnalyzer(if you're using SQL Server otherwise copy/paste in Access and execute your query) from there you'll be able to see if the query "you are about to execute will return you some data"