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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I give up.... 1

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
Ok gurus, I need help real bad.
I have a table with 6 fields. Fields 1-4 display data from previous input form, when my users update records from the previous form I'm populating fields 5 and 6 with updated entries.
I'm good with looping data from original input 1-4 but I'm having problems looping data on fields 5-6 using a loop.
I guess my question is:


How do I loop fields 5-6 if 1-4 are already in a loop??

1 2 3 4 5 6

Thank you in advance.. QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 
I'm sorry, but I need more details, not sure what you mean, unless you have it in a form of code that we can interpret (for example, what your question may sound like, can be completely different from what you want) Karl Blessing
aka kb244{fastHACK}
 
Could you please post a sample of your code to see what you really need ??
 
Here we go fellas

I did not want to paste my tables here because it would be too long, I simply (if possible) need to know how to loop within an already looped table.

Being a rookie at ASP programming, I'm probably approaching this the wrong way, but for now is the only way I know.

HERE WE GO FELLAS

Here are my tables: (I hope you understand)

Table 1


sql = &quot;Select * from entries order by timedorderd&quot;
Dim RSentries
set RSentries=server.createobject(&quot;ADODB.recordset&quot;)
RSentries.open sql, &quot;DSN=mydb1&quot;
<%
Do While Not RSentries.EOF
%>

<td width=&quot;87&quot;><font size=&quot;2&quot; color=&quot;#000080&quot;>
<p align=&quot;left&quot;></font><font size=&quot;2&quot; color=&quot;#0000FF&quot;><<%=RSentries(&quot;dateordered&quot;)%></font></td>
<center>
<td width=&quot;288&quot;><font size=&quot;2&quot; color=&quot;#000080&quot;><%=RSentries(&quot;client&quot;)%></font></td>
<td width=&quot;420&quot;><font size=&quot;2&quot; color=&quot;#000080&quot;><%=RSentries(&quot;address&quot;)%></font></td>
<td width=&quot;106&quot;><font size=&quot;2&quot; color=&quot;#000080&quot;><%=RSentries(&quot;salesperson&quot;)%></font></td>
<td width=&quot;84&quot; bgcolor=&quot;#FFFFCC&quot; align=&quot;center&quot;><font size=&quot;1&quot; color=&quot;#000080&quot;><%=RSentries(&quot;timeordered&quot;)%></font></td>
<td width=&quot;80&quot; bgcolor=&quot;#CCFFFF&quot; align=&quot;center&quot;><font size=&quot;1&quot; color=&quot;#000080&quot;><%=RSentries(&quot;dateneeded&quot;)%></font></td>

***** Notice that my Loop for &quot;RSentries.MoveNext&quot;*********
is not here but at the very bottom of the code.



This table is then submitted. Now, when the user updates this table (by entering &quot;Date shipped&quot; and\or &quot;Canceled&quot;). I'm simply displaying the same entered data from my database, but this time I've added new display fields (Date Shipped\Canceled) to the page. and need to loop those fields within the above table.


Table 2
sql2 = &quot;Select * from updates order by dateneeded&quot;
Dim RSentries2
set RSentries2=server.createobject(&quot;ADODB.recordset&quot;)
RSentries2.open sql2, &quot;DSN=updates&quot;

<%
Do While Not RSentries2.EOF
%>

</center>

<td width=&quot;61&quot; align=&quot;center&quot;><font size=&quot;2&quot; color=&quot;#000080&quot;><p align=&quot;left&quot;><%=RSentries2(&quot;dateshipped&quot;)%></font></td>
<center>
<center>
<td width=&quot;80&quot; bgcolor=&quot;#CCFFFF&quot; align=&quot;center&quot;><font size=&quot;1&quot; color=&quot;#000080&quot;><%=RSentries2(&quot;canceled&quot;)%></font></td>

<%
RSentries2.MoveNext
LOOP
%>


<%
RSentries.MoveNext
LOOP
%>


QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 
Fellas, I apologize for wasting your time on this. After taking a smoke break and analyzing my situation, I've decided to approach it a litte diferently.

Instead of posting my updates to a new page. I will display all the fields with empty not-yet updated fields and do my select thru SQL. Once that particualar file has been updated I will simply re-direct my users to the same page showing the updated fiels.


If you guys found a way to do what I had ask, please post it here, I'm sure it will benefit us.

Thank you very much for your time guys.








QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 
ok ,I assume you want to do two loops, because you have two different queries (and you know which order they go in I assume) , no one said you had to write the HTML while you were processing, you could, if you wanted to, write the HTML to a string variable, then when doing the second loop write that to a string, and figure a way to merge them (like a neat way would be to have two tables in HTML stored in string 1 and string 2, put one table on left, and other on right, and just make it appear as if it's all one table) Karl Blessing
aka kb244{fastHACK}
 
Great point Karl, can you point me to where I can learn how to variable string HTML tables? I'm very new to ASP's and just began scratching the surface. QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 

Anytime QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 
I'll probally grab you some of my old code at the end of the day or so, since I do the same thing for MultiPrint because I wanted to do two columns, but couldnt work like that in the data. (cant do left to right, had to be top to bottom then move right) Karl Blessing
aka kb244{fastHACK}
 

That's cool, at your leisure.
But if you can still point me to where I can learn how to write the HTML to a string variable, I would appreciate it QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 
this is a quick typical example of what I mean

sometimes you do

<% if thisistrue then %>
some HTML here
<% end if %>

it's also the same as

<% if thisistrue then
response.write &quot;Some html here&quot;
end if
%>

so if its treated like a string anyways.

whats the say we cant put it into a string, then finally &quot;response.write&quot; when we're ready to show it the way we want it.
<%
if thisistrue then
MyHTMLString = MyHTMLString & &quot;some html here&quot;
end if
%>

so in the end, when yer ready to combine your HTMLs

Response.write HTMLString1 & HtmlString2

that should spit out all the HTML you stored in the variables, back to the client. Karl Blessing
aka kb244{fastHACK}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top