simflex
07-25-2003, 04:29 PM
hi everyone,
ok, this is not the typical complex questions I usually ask on this forum.
I am querying the database and displaying records returned to the .
So I have :
empid first name last name title status
Then their values will be display in an html table
using the traditional <table><tr><td></td></tr></table>
tags.
I am also using a paging mechanism since the client wants 7 records displayed per page.
So far, everything works great.
Here is my problem.
Each empid comes in multiples of 3.
In other words, looking at this example:
empid first name last name title status
1 sim maxwell programmer open
1 Martin short Comedial open
1 John MCenroe Tennis Complete
From this simple example, empId comes in multples of 3.
empid 1 (3 times), empid 2(3 times), empid 3(3times), you get the picture.
I need to put each set of empids with their associated values in a box, followed by a blank row and the the next set of 3 empids followed by blank row.
Each set of empids need to be followed with a blank row to separate them out.
Is their anyway I can get someone to help me, please.
The code I am using just jumbles all the records together and make them unreadable.
Here is a snippet of what I have so far. Perhaps someone can tell me what I am doing wrong.
This is not the entire code, just snippet
Thanks in advance.
'Build table header
With Response
.write "<table border=1 cellpadding=5 cellspacing=0>"
.write "<tr bgcolor=silver>"
.write "<td>ID Number</td>"
.write "<td>Date Of Event</td>"
.write "<td>Time Of Event</td>"
.write "<td>Operator Involved</td>"
.write "<td>Type</td>"
.write "<td>Name</td>"
.write "<td>Accident Notes</td>"
.write "<td>Call back Number</td>"
.write "<td>Date & Time Info Entered</td>"
.write "<td>Completed?</td>"
.write "</tr>"
end with
Dim Count 'We'll use this to limit the number of records displayed on a page
Dim nLastID,trackingNumber
Dim bFirstChange
nLastID = -1 ' Initialize the id comparing variable.
bFirstChange = True ' Initialize flag that checks for first change of IDs.
Count = 1
do while NOT rst.EOF AND Count <= IntPageSize
If trackingNumber <> nLastID Then ' A change in EmpID has occurred
If bFirstChange = False Then
Response.Write "<tr>"
Response.Write "<td colspan=3> *</td></tr>"
Else
bFirstChange = False
End If
Response.Write "<tr><td colspan=3>Tracking#" & rst("trackingNumber") & "<td></tr>"
nLastID = trackingNumber
End If
Response.Write "<tr>"
Response.Write "<td>" & rst("DateOfEvent") & "</td>"
Response.Write "<td>" & rst("TimeOfEvent") & "</td>"
Response.Write "<td>" & rst("staffMem") & "</td>"
%>
<td>
<% If rst("type") = "Programmer" Then
Response.Write "<font color=""#000000"">Programmer</font>"
ElseIf rst("type") = "tenn" Then
Response.Write "<font color=""#000000"">Tennis Player</font>"
Else
Response.Write "<font color=""#000000"">Comedian</font>"
End If %>
</td>
<%
Response.Write "<td>" & rst("fullname") & "</td>"
Response.Write "<td>" & rst("accidentNotes") & "</td>"
Response.Write "<td>" & rst("callbackNumber") & "</td>"
Response.Write "<td>" & rst("DateTimeLog") & "</td>"
%>
<td>
<% If rst("Completed") = 0 Then
Response.Write "<font color=""#FF0000"">No</font>"
Else
Response.Write "<font color=""#009900"">Yes</font>"
End If %>
</td>
<%
Response.write "</tr>"
count = count + 1
rst.MoveNext
loop
ok, this is not the typical complex questions I usually ask on this forum.
I am querying the database and displaying records returned to the .
So I have :
empid first name last name title status
Then their values will be display in an html table
using the traditional <table><tr><td></td></tr></table>
tags.
I am also using a paging mechanism since the client wants 7 records displayed per page.
So far, everything works great.
Here is my problem.
Each empid comes in multiples of 3.
In other words, looking at this example:
empid first name last name title status
1 sim maxwell programmer open
1 Martin short Comedial open
1 John MCenroe Tennis Complete
From this simple example, empId comes in multples of 3.
empid 1 (3 times), empid 2(3 times), empid 3(3times), you get the picture.
I need to put each set of empids with their associated values in a box, followed by a blank row and the the next set of 3 empids followed by blank row.
Each set of empids need to be followed with a blank row to separate them out.
Is their anyway I can get someone to help me, please.
The code I am using just jumbles all the records together and make them unreadable.
Here is a snippet of what I have so far. Perhaps someone can tell me what I am doing wrong.
This is not the entire code, just snippet
Thanks in advance.
'Build table header
With Response
.write "<table border=1 cellpadding=5 cellspacing=0>"
.write "<tr bgcolor=silver>"
.write "<td>ID Number</td>"
.write "<td>Date Of Event</td>"
.write "<td>Time Of Event</td>"
.write "<td>Operator Involved</td>"
.write "<td>Type</td>"
.write "<td>Name</td>"
.write "<td>Accident Notes</td>"
.write "<td>Call back Number</td>"
.write "<td>Date & Time Info Entered</td>"
.write "<td>Completed?</td>"
.write "</tr>"
end with
Dim Count 'We'll use this to limit the number of records displayed on a page
Dim nLastID,trackingNumber
Dim bFirstChange
nLastID = -1 ' Initialize the id comparing variable.
bFirstChange = True ' Initialize flag that checks for first change of IDs.
Count = 1
do while NOT rst.EOF AND Count <= IntPageSize
If trackingNumber <> nLastID Then ' A change in EmpID has occurred
If bFirstChange = False Then
Response.Write "<tr>"
Response.Write "<td colspan=3> *</td></tr>"
Else
bFirstChange = False
End If
Response.Write "<tr><td colspan=3>Tracking#" & rst("trackingNumber") & "<td></tr>"
nLastID = trackingNumber
End If
Response.Write "<tr>"
Response.Write "<td>" & rst("DateOfEvent") & "</td>"
Response.Write "<td>" & rst("TimeOfEvent") & "</td>"
Response.Write "<td>" & rst("staffMem") & "</td>"
%>
<td>
<% If rst("type") = "Programmer" Then
Response.Write "<font color=""#000000"">Programmer</font>"
ElseIf rst("type") = "tenn" Then
Response.Write "<font color=""#000000"">Tennis Player</font>"
Else
Response.Write "<font color=""#000000"">Comedian</font>"
End If %>
</td>
<%
Response.Write "<td>" & rst("fullname") & "</td>"
Response.Write "<td>" & rst("accidentNotes") & "</td>"
Response.Write "<td>" & rst("callbackNumber") & "</td>"
Response.Write "<td>" & rst("DateTimeLog") & "</td>"
%>
<td>
<% If rst("Completed") = 0 Then
Response.Write "<font color=""#FF0000"">No</font>"
Else
Response.Write "<font color=""#009900"">Yes</font>"
End If %>
</td>
<%
Response.write "</tr>"
count = count + 1
rst.MoveNext
loop