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

separating table rows 2

Status
Not open for further replies.

accessguy52

Programmer
Joined
Sep 18, 2002
Messages
73
Location
US
Hello folks, I'm back again with another headache - does anyone have code to deal with formatting or splitting a lot of data from from an Access recordset into asp table? In other words, here is what I need:

ID Name Address City State Zip
-- ---- ------- --- ----- ---
123 Joe Blow 123 Ivy NYC NY 21212


This That Something SomethingElse
---- ---- --------- -------------
blah blah blahblah blahhhhblah
etc.

--instead of a long horizontal table, I need to break up the headers and fields containing the recordset. Let me know if this is not clear. This is something most tech books don't have an example of. Many thanks!!

accessguy52 accessguy52
 
I think that you will still want on record per row (just multiple lines per record)


do while not objrs.eof
html = html &_
&quot;<tr>&quot;&_
&quot;<td>&quot; & objrs(&quot;ID&quot;) & &quot;</td>&quot;&_
&quot;<td>&quot; & objrs(&quot;Name&quot;) & &quot;<br>&quot;&_
objrs(&quot;Address&quot;) & &quot;<br>&quot;&_
objrs(&quot;City&quot;) & &quot;, &quot; & objrs(&quot;state&quot;) & &quot; &quot; & objrs(&quot;zip&quot;) & &quot;</td>&quot;&_
&quot;<td>Home: &quot; & objrs(&quot;homePhone&quot;) & &quot;<br>&quot; &_
&quot;Work: &quot; & objrs(&quot;workPhone&quot;) & &quot;</td>&quot;&_
&quot;<td>&quot; & objrs(&quot;That&quot;) & &quot;</td>&quot;&_
&quot;<td>&quot; & objrs(&quot;something&quot;) & &quot;</td>&quot;&_
&quot;</tr>&quot;
objrs.movenext
loop Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Thanks, mwolf00 - been busy for awhile. I took your code and modified it a bit. Now I have to show it to my boss! Wish me luck.

accessguy52 [bigsmile] accessguy52
 
Good luck! Thanks for the Star! Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
mwolf - Well, my boss (who is a great boss) has changed his mind and is trying for a form concept rather than table. How can I get text fields without enabling input - in other words just display the fields like text boxes but not allowing editing? Would it be &quot;document.write&quot;?

Thanks - accessguy

P.S. You're welcome. accessguy52
 
just incorpurate the recordsets into a intput field with a readonly attribute
&quot;<tr>&quot;&_
&quot;<td><input type=&quot;&quot;text&quot;&quot; value='&quot; & objrs(&quot;ID&quot;) & &quot;'&quot;readonly></td>&quot;&_

not sure on that syntax
---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
All you need to do is use styles (CSS) to change the look and feel of the table, no need to change the output to be in text inputs if the user isn't allowed to input text.

Or you could put it in input boxes if you really want to:
Code:
&quot;<td><input type='text' onFocus='this.blur();' value='&quot; & objrs(&quot;ID&quot;) & &quot;'></td>&quot;&_

Tada, instant text box that when someone tabs or clicks on it they will be blurred, ie lose focus to that box, ie not be able to type in it.

I'd still go with styles though :)

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Ack, I was beaten to the click click ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
AN important thing to remember is that the READONLY attribute does not work in NetScape. So it's important to use Tarwyn's &quot;onFocus='this.blur();&quot; (although it keeps ppl from highliting and copiing). Another solution (tedious)...

<input READONLY value=&quot;Joe Smith&quot; onBlur=&quot;this.value=hideField.value&quot;>

<input type=hidden value=&quot;Joe Smith&quot; name=&quot;hideField&quot;> Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Thanks, guys, I'm throwing out the table idea and just going for a simple form approach, as my boss suggested. The form is supposed to mimic a corresponding access form. So I'll just go with the readonly approach.

On a personal note, hope your holidays were great. As for me, I caught an &quot;airplane cold&quot; which broke out Christmas Day while we were in Innsbruck, Austria. Saw and heard a wonderful CHristmas Day Mass though, complete with full orchestra and choir playing Mozart. If you care to, you may browse thru my vacation pics at:


Thanks again accessguy52
 
Thanks, guys, I'm throwing out the table idea and just going for a simple form approach, as my boss suggested. The form is supposed to mimic a corresponding access form. So I'll just go with the readonly approach.

On a personal note, hope your holidays were great. As for me, I caught an &quot;airplane cold&quot; which broke out Christmas Day while we were in Innsbruck, Austria. Saw and heard a wonderful CHristmas Day Mass though, complete with full orchestra and choir playing Mozart. If you care to, you may browse thru my vacation pics at:

double click on Innsbruck Trip folder.

Thanks again accessguy52
 
I think readonly was added to NN in 6.2 and on.
possitive on 7.0 ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
Took 'em long enough.... Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Guys - I found it..it goes like this

<B> Record ID:</B><input type=&quot;text&quot; readonly value=<% = rs(&quot;Record_ID&quot;)%>>
<B> Aspen ID:</B><input type=&quot;text&quot; readonly value=<% = rs(&quot;Aspen_ID&quot;)%>>
<B> Last Name:</B><input type=&quot;text&quot; readonly value=<% = rs(&quot;Last_Name&quot;)%>>

I took Tarwn's code and had to play with until it looked like the above. It gives me a text box, disabled with the record fields in them, like the access form. Way to go, Tarwn! Thanks for the tip! Also, mwolf00 and onpnt, too.

Until the next headache...

accessguy52 accessguy52
 
I think you need &quot; &quot; around the rs though.
<B> Record ID:</B><input type=&quot;text&quot; readonly value=&quot;<% = rs(&quot;Record_ID&quot;)%>&quot;>
<B> Aspen ID:</B><input type=&quot;text&quot; readonly value=&quot;<% = rs(&quot;Aspen_ID&quot;)%>&quot;>
<B> Last Name:</B><input type=&quot;text&quot; readonly value=&quot;<% = rs(&quot;Last_Name&quot;)%>&quot;>

obviously it worked for you though.
---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
I would still like to se some more CSS instead of the input box, why not do something like this:
Code:
<html>
<head>
<style>
.displayTable{
	margin-top:10px;
	background:#bbbbbb;
	width:90%;
	border-right:1px solid #555555;
	border-bottom:1px solid #555555;
	font-size:13px;
	}
.displayTable td{
	background:#f5f5f5;
	padding-left:5px;
	padding-right:5px;
	border-left:1px solid #666666;
	border-top:1px solid #666666;
	border-bottom:1px solid #eeeeee;
	border-right:1px solid #eeeeee;
	text-align:justify;
}
.displayTable td .inputEntry{
	border:0px;
	width:100%;
	margin:0px;
	text-align:justify;
}
.displayTable .columnHeader{
	background:#bbbbbb;
	border-top:1px solid #eeeeee;
	border-left:1px solid #eeeeee;
	border-right:1px solid #555555;
	border-bottom:1px solid #555555;
	margin:0px;
	text-align:center;
	font-size:14px;
	text-align:center;
}
</style>
</head>
<body>
<table class=&quot;displayTable&quot;>
	<tr>
		<td class=&quot;columnHeader&quot; width=&quot;150&quot;>
			Column Name 1
		</td>
		<td>
			Some data
		</td>
		<td>
			Some more data
		</td>
	<tr>
		<td class=&quot;columnHeader&quot;>
			Column Name 2
		</td>
		<td>
			Some data
		</td>
		<td>
			Some more data
		</td>
	<tr>
		<td class=&quot;columnHeader&quot;>
			Column Name 3
		</td>
		<td>
			Some data
		</td>
		<td>
			Some more data
		</td>
</table>
Or<br>
<table class=&quot;displayTable&quot;>
	<tr>
		<td class=&quot;columnHeader&quot; width=&quot;10&quot;>
			&nbsp;
		</td>
		<td class=&quot;columnHeader&quot;>Column 1</td>
		<td class=&quot;columnHeader&quot;>Column 2</td>
		<td class=&quot;columnHeader&quot;>Column 3</td>
	</tr>
	<tr>
		<td class=&quot;columnHeader&quot;>
			1
		</td>
		<td>Some Data</td>
		<td>Some Data</td>
		<td>Some data</td>
	</tr>
	<tr>
		<td class=&quot;columnHeader&quot;>
			2
		</td>
		<td>More Data</td>
		<td>More Data</td>
		<td>More Data</td>
	</tr>
</body>
</html>

Just a thought, but I think this looks a little spiffier than standard input boxes.

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Tarwn - thanks, I'll try it out even though what I have now is sufficient.

BTW, bought &quot;Javascript Visual Quickstart Guide&quot; and it's pretty nifty. It's helped me to throw up message boxes when there's no value in textboxes for example. Keeps me from displaying my ignorance in forums like this - [lol]
accessguy52
 
Heh, feel free to keep a copy of that style sheet, it isn't much, but I use it on a timecard site that wanted a more &quot;Excel&quot; like feel. I actually copied and pasted most of that directly from the site :P

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Let me clarify, I wrote the CSS I just didn't keep a copy handy, which is why I copied it back from the site. Just in case someone was worried about wierd copyrights :)
(I only copyright stuff that is over 400 lines long and it's usually pretty noticeable.)

Wierd, &quot;Big Tracts of land...&quot; just went through my head... :P

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
&quot;Big tracts of land?&quot; -- hey, get a grip!! Enjoy your weekend. Nothing going on ASP-wise at the moment, just spent my day quietly goofing off in my cube, reading &quot;Beginning ASP 3.0&quot; while I have some down-time.

[yawn]

'til next time...
accessguy52
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top