|
| |
|
|
RobM_01
Posts: 135 Joined: 1/1/2004 Status: offline
|
A tweak required with Spookys Grouped Headers - 5/1/2004 17:10:41
Can anyone help point me in the right direction to fix this? I would like to make use of Spookys Group Headers to display the category chosen from a drop down list box to show with the results, but the value shown is a number. If I use the following code I get the number, which is fine but I want the actual word if possible.
<%
DIM GroupName,tmpGroupName
GroupName=FP_FieldVal(fp_rs,"CatID")
If GroupName <> tmpGroupName then
tmpGroupName=GroupName
%>
<td colspan=5><%=tmpGroupName%> </td>
</tr>
<tr>
<%end if%>
This is the field name I want to use but can't get it to work.
<%
DIM GroupName,tmpGroupName
GroupName=FP_FieldVal(fp_rs"CatDesc")
If GroupName <> tmpGroupName then
tmpGroupName=GroupName
%>
<td colspan=5><%=tmpGroupName%> </td>
</tr>
<tr>
<%end if%>
Below is the form that produces the dynamic drop down, which Betheball and Spooky helped me with a while back to in order to put the worded cats in the list and pass the number value to the results.
<form botid="0" method="POST" action="search.asp" name="Form1">
<nobr><p align="right">
<!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry=QSearchCat
fp_sDefault=""
fp_sNoRecords=""
fp_sDataConn="DBConn2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="CatDesc"
fp_sMenuValue="CatID"
fp_sColTypes="&CatDesc=202&CatID=3&"
fp_iDisplayCols=2
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<select name="Cat" size="1" onchange="Form1.submit()">
<option></option>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<option value="<%=FP_FieldHTML(fp_rs,"CatID")%>" <%if request.form("cat") = fp_fieldhtml(fp_rs,"catid") then response.write "selected"%>>
<%=FP_FieldHTML(fp_rs,"CatDesc")%></option>
<!--#include file="_fpclass/fpdbrgn2.inc"-->
</select>
</p></nobr>
</form>
Cheers Rob.
|
|
|
|
RobM_01
Posts: 135 Joined: 1/1/2004 Status: offline
|
RE: A tweak required with Spookys Grouped Headers - 5/2/2004 16:56:37
Hi Spooky, thanks for the code, I added it as shown below in the coded section but it has failed with the following message: -------------------------------------------------------------------------------- Technical Information (for support personnel) Error Type: ADODB.Recordset (0x800A0CC1) Item cannot be found in the collection corresponding to the requested name or ordinal. /DIB_Test/_fpclass/fpdblib.inc, line 48 Browser Type: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322) Page: POST 6 bytes to /DIB_Test/description.asp POST Data: Cat=24 Time: 02 May 2004, 21:43:01 More information: Microsoft Support
<%@ Language=VBScript %> <%
DIM QSearchCat
DIM QResultsCat
QSearchCat = "SELECT * FROM tCat ORDER BY CatDesc"
QResultsCat = "SELECT DISTINCT tCat.CatID, Photo.* FROM ((tCat INNER JOIN tSCat ON tCat.CatID = tSCat.CatID) INNER JOIN tSSCat ON tSCat.SCatID = tSSCat.SCatID) INNER JOIN (Photo INNER JOIN SSC2Photo ON Photo.PhotoID = SSC2Photo.PhotoID) ON tSSCat.SSCatID = SSC2Photo.SSCatID WHERE (((tCat.CatID)=::Cat::)); "
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Description</title>
</head>
<body>
<form botid="0" method="POST" action="description.asp" name="Form1">
<nobr>
<p align="right">
<!--#include file="_fpclass/fpdblib.inc"--><%
fp_sQry=QSearchCat
fp_sDefault=""
fp_sNoRecords=""
fp_sDataConn="DBConn2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="CatDesc"
fp_sMenuValue="CatID"
fp_sColTypes="&CatDesc=202&CatID=3&"
fp_iDisplayCols=2
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%> <select name="Cat" size="1" onchange="Form1.submit()">
<option></option>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<option value="<%=FP_FieldHTML(fp_rs,"CatID")%>" <%if request.form("cat") = fp_fieldhtml(fp_rs,"catid") then response.write "selected"%>>
<%=FP_FieldHTML(fp_rs,"CatDesc")%></option>
<!--#include file="_fpclass/fpdbrgn2.inc"--></select> </p>
</nobr>
</form>
<table width="100%" border="0" id="tblPhotosFromCat" cellpadding="3" cellspacing="1">
<tr>
<td>
<p>Description</p>
</td>
<td>
<p>Photographer</p>
</td>
<td>
<p>Date taken</p>
</td>
<td>
<p>Original File size</p>
</td>
<td>
<p>Image</p>
</td>
</tr>
<!--#include file="_fpclass/fpdblib.inc"--><%
fp_sQry=QResultsCat
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=5 align=""LEFT"" width=""100%""></td></tr>"
fp_sDataConn="DBConn2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=4
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&CatID=3&PDesc=202&Filename=202&PhotoID=3&PhotogID=3&Date=135&Size=202&"
fp_iDisplayCols=5
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%
DIM GroupName,tmpGroupName
GroupName=FP_FieldVal(fp_rs,"CatDesc")
If lcase(GroupName) <> lcase(tmpGroupName) then
tmpGroupName=GroupName
%>
<td colspan=5><%=tmpGroupName%> </td>
</tr>
<tr>
<%end if%>
<tr>
<td><%=FP_FieldVal(fp_rs,"PDesc")%></td>
<td><%=FP_FieldVal(fp_rs,"PhotogID")%></td>
<td><%=FP_FieldVal(fp_rs,"Date")%></td>
<td><%=FP_FieldVal(fp_rs,"Size")%></td>
<td><%=FP_FieldVal(fp_rs,"Filename")%></td>
</tr>
<!--#include file="_fpclass/fpdbrgn2.inc"-->
</table>
</body>
</html>
Cheers Rob.
|
|
|
|
RobM_01
Posts: 135 Joined: 1/1/2004 Status: offline
|
RE: A tweak required with Spookys Grouped Headers - 5/2/2004 19:40:19
yes thats right, CatDesc does not exist in the table photos. I just thought mabe it could somehow be taken from the form that queries tCat at the beginning where it does exist. Is it not possible to do this?
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|