"Brian Shafer" <
[email protected]> wrote in message
Jim,
this is the SQL Statement I have on my custom query for the first page. It
returns an error????
Am I correct that TeamID is the query search field for the next page?
SELECT '<a
href="javascript:window.open(''volleyball_Team_Members.asp?TeamID=' &
[numTeam] &
''',null,''height=200,width=400,status=no,toolbar=no,menubar=no,location=no'
);void(0);">'
as Team, txtFirstName as [First Name], txtLastName as [Last Name],
txtHomePhone as [Contact Number] FROM tblVolleyBallTeams where
chkTeamCaptain = 1 ORDER BY numTeam ASC,chkTeamCaptain ASC,txtFirstName
ASC,txtLastName ASC
What am I missing here?
Thanks, Brian
Yes, there are a lot of tricky nested apostrophes here. Just remember that in SQL:
o You must enclose text literals in apostrophes (').
o To put an apostrophe *inside* a text literal, code two apostrophes.
(i.e. to get O'Hara, code 'O''Hara'.)
o Within apostrophes, quotation marks (") are just ordinary characters.
o If you code JavaScript inside an HTML attribute value, use apostrophes
rather than quotation marks. For example:
<a href="javascript:window.open('mypage.htm')">
Given all that, try this:
Alternatively, add this script to the <head> section of your page:
SELECT '<a href="javascript:window.open(''volleyball_Team_Members.asp?TeamID='
& [numTeam] & ''', null,'
& '''height=200,width=400,status=no,toolbar=no,menubar=no,location=no'''
& ' ;void(0);">'
& [numTeam] & '</a>' AS Team,
txtFirstName as [First Name],
txtLastName as [Last Name],
txtHomePhone as [Contact Number]
FROM tblVolleyBallTeams where chkTeamCaptain = 1
ORDER BY numTeam ASC,
chkTeamCaptain ASC,
txtFirstName ASC,
txtLastName ASC
<script>
function openTeam(aTeam){
window.open("volleyball_Team_Members.asp?TeamID=" + aTeam , null,
"height=200,width=400,status=no,toolbar=no,menubar=no,location=no");
}
</script>
and then code your SQL statement:
SELECT '<a href="javascript
penTeam(' &
[numTeam] &
');">' & [numteam] & '</a>' AS Team,
txtFirstName as [First Name],
txtLastName as [Last Name],
txtHomePhone as [Contact Number]
FROM tblVolleyBallTeams where chkTeamCaptain = 1
ORDER BY numTeam ASC,
chkTeamCaptain ASC,
txtFirstName ASC,
txtLastName ASC
'<a href="javascript
penTeam(' & [numTeam] & ');">' & [numteam] & '</a>'
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------