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!

Help with table

Status
Not open for further replies.

JackSkellington

Technical User
Jul 28, 2005
86
GB
Hi I need to add some columns to the table, I thought this would be as simple as adding another:

<td class="head"<%= strCellHead %>>Unauthorised</td>

with the apporpriate:

<td><%= rsSundries("Number").Value %>&nbsp;</td>

But this does not seem to work as it fills the column with a check box. Also the date and No. of Receipts fields don't seem to be populating.

Any help most appreciated

Jack


Code:
<!-- Heading of the Sundry table -->
			<table cellpadding="4" cellspacing="0" id="sundries"<%= strTable %>>
				<tr>
					<td class="head"<%= strCellHead %>>Date</td>
					<td class="head"<%= strCellHead %>>Sundry Item</td>
					<td class="head"<%= strCellHead %>>No. of Receipts</td>
					<td class="head"<%= strCellHead %>>Amount</td>
					<td class="head"<%= strCellHead %>>Authorised</td>
					<td class="head"<%= strCellHead %>>Unauthorised</td>
				</tr>
<% 
			Dim rsSundries
			sQuery = "up_retrieveSundriesAuth " & Request("EmployeeNo") & ",'" & sMonth & "01', '" & sNextMonth & "01'"
			Set rsSundries = OpenRecordset(sQuery)
			While Not rsSundries.EOF
				sID = rsSundries("ID").Value
				If IsNull(rsSundries("AuthorisedBy").Value) Then 'Unauthorised
					sStatus = "<td><input type=""Radio"" name=""sundry" & sID & """ value=""1"" onClick=""changed = true""></td><td><input type=""Radio"" name=""sundry" & sID & """ value=""0"" onClick=""changed = true"" checked><input type=""hidden"" name=""sundry" & sID & """ value=""U""></td>"
				Else 'Manager Authorised
					If IsNull(rsSundries("PayrollAuthBy").Value) Then 'Payroll Authorised
						sStatus = "<td><input type=""Radio"" name=""sundry" & sID & """ value=""1"" onClick=""changed = true"" checked></td><td><input type=""Radio"" name=""sundry" & sID & """ value=""0"" onClick=""changed = true""><input type=""hidden"" name=""sundry" & sID & """ value=""A""></td>"
					Else 'Payroll Unauthorised
						sStatus = "<td colspan=""2"">Payroll Authorised</td>"
					End If
				End If 
%>
				<tr>
					<td><%= FormatDateTime(rsSundries("Date").Value, vbShortDate) %>&nbsp;</td>
					<td><%= rsSundries("Description").Value %>&nbsp;</td>
					<td><%= rsSundries("Number").Value %>&nbsp;</td>
					<td><%= FormatNumber(rsSundries("Amount").Value, 2) %>&nbsp;</td>
					<%= sStatus %>
				</tr>
<%
				'Don't forget to advance on to the next record at the end of the loop
				rsSundries.MoveNext
			Wend
			'Tidy up...
			rsSundries.Close
			Set rsSundries = Nothing
%>
 
Sometimes it helps to work backwards from the HTML.

Open your ASP in the browser and then click "View Source" to get the HTML output of your ASP script. Then save the source file and use .htm as the extension. Then edit the plain HTML until you get the look you want. Now that you know how you want your HTML to be, you can return to the ASP and tweak the code so that it produces the desired HTML.
 
Try using the cols=X in the table statement:

<table cols=2>

Of course use the other parameters in your posting.

You have also named to objects with the name "sundry". All you need to do is refer to the radio object at it already has the record ID.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top