- see footer for list info -<
Thanks Russ....

I have it working now.....

I Did this ....




<!--- How many Victims are recorded? --->
                                <cfquery name="GetVictims" 
datasource="#Application.RacistDSN#">
                                        SELECT dbo.tblVictims.VictimIDPK
                                        FROM dbo.tblVictims
                                        WHERE (dbo.tblVictims.IncidentIDFK = 
'#session.recordtomodify#')
                                </cfquery>
                                <cfset NumberOfVictims = 
#GetVictims.RecordCount#>

                                <!--- Create a list to hold the record id's of 
those records --->
                                <cfset VictimIDList = 
ValueList(GetVictims.VictimIDPK)>

                                <cfoutput>
                                        Number of victims - 
#NumberOfVictims#<br>
                                        Victim ID's - #VictimIDList#<br>
                                </cfoutput>

<!--- Set a default url.value to 1 and increment this when the user clicks the next
                                victim button ---->
                                <cfparam name="URL.ElementToGet" default="1">

<!--- Now get the record ID from the list dependant on what the URL value
                                is set to --->
                                <cfset recordtoGet = #ListGetAt(VictimIDList, 
URL.ElementToGet)#>

                                <cfoutput>This is record - 
#recordtoget#</cfoutput>




                                <!--- Now get the victim dependant on the 
record number
                                contained in the list --->
                                <cfquery name="GetVictims" 
datasource="#Application.RacistDSN#">
                                        SELECT dbo.tblVictims.VictimName,
                                                dbo.tblVictims.YearGroupIDFK,
                                                dbo.tblVictims.EthnicGroupIDFK,
                                                dbo.tblVictims.Gender,
                                                
dbo.tblVictims.ReligiouslyMotivated,
                                                dbo.tblVictims.PreviousVictim,
                                                dbo.tblVictims.MemberOfStaff,
                                                dbo.tblVictims.Child_School,
                                                dbo.tblVictims.Adult_School,
                                                dbo.tblVictims.OtherCodeIDFK
                                        FROM dbo.tblVictims
                                        WHERE (dbo.tblVictims.VictimIDPK = 
'#recordtoget#')
                                </cfquery>



Blah Blah Blah ...... (display stuff.....)


<!--- If there are no more records in the list then don't show the next victim button --->
                                <cfif URL.ElementToGet LT ListLen(VictimIdList)>
                                        <!--- if there are then increment the 
elementtoget --->
                                        <cfset ElementToGet = URL.ElementToGet + 
1>
                                        <cfoutput>
<input type="submit" name="clickme1" value="Next victim" onClick="this.form.action='ModifyData.cfm?rpt=1&ElementToGet=#ElementToGet#';">
                                        </cfoutput>
                                </cfif>


It seems to work ....

Regards - Paul


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to