Here is the complete code for the page please help this is driving me nuts!X-)
<%@ language=VBScript%>
<%
dim con, rst, sql, msgId
dim recip
set user = request.QueryString("user"
set con=Server.CreateObject("ADODB.Connection"

Call con.Open("COED_DSN", "BoabFett", "noddy1"

set sql ="SELECT*FROM Messages WHERE Recipient=public"
set rst=Server.CreateObject("ADODB.Recordset"

Call rst.Open(sql, con)
set msgId=rst("MessageId"
Call rst.Close()
set rst=Nothing
Function viewMsg(val)
set sql = String("SELECT * FROM Messages WHERE MessageID="& val)
set rst = Server.CreateObject("ADODB.Recordset"

Call rst.Open(sql, con)
return rst("MessageTxt"

End Function
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
tr.DataInfo{backgroundcolor;aliceblue;color:cyan}
</style>
<script language=javascript>
<!--
function viewMsg(val) {
var w =window.open(width=400, height=350, status=no,resizable=no);
w.document.write("<textarea cols=50 value="+"+val+""></textarea>"

w.document.write("<input type="+"+"button"+"+" Value="+"+"Close"+"+" onClick="+"+"javascript:window.close()"+"+">"

;
}
-->
</script>
</head>
<body bgcolor="#000066" text="#00FFFF" background="../1163k5Edinburgh.gif" link="#00FFFF" vlink="#00FFFF" alink="#00FFFF">
<div align="center">
<p><font size="7"><i>C</i></font><font size="5">ity of <font size="7"><i>E</i></font>dinburgh
<font size="7"><i>P</i></font>ipes & <font size="7"><i>D</i></font>rums</font></p>
<p><font size="5"><i><font size="7">P</font></i>ublic <font size="7"><i>M</i></font>essage
<font size="7"><i>B</i></font>oard</font></p>
<p> </p>
</div>
<div align="center">
<table>
<tr style=fontfamily:verdana;backgroundcolor:aliceblue;color:cyan>
<td>Message Subject</td>
<td>Sender</td>
<td>Date/Time sent</td>
<td>View Message Text</td>
</tr>
<%
While(rst.EOF=false)
Response.Write("<tr class=DataInfo>"&vbCrLf)
Response.Write("<td>"& rst("msgSubj"

&"</td>"&vbCrLf)
Response.Write("<td>"& rst("Sender"

&"</td>"&vbCrLf)
Response.Write("<td>"& rst("DateTime"

&"</td>"&vbCrLf)
Response.Write("<td><input type ="" &"button"" &"value="" &"View Message"" &"onClick="" &"viewMsg(msgId)"" &"></td>"&vbCrLf)
Response.Write("</tr>"&vbCrLf)
Wend
%>
</table>
</div>
</body>
</html>