>- see footer for list info -<
If you want to get away from all those fully qualified table references use
an alias so this:

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#')

becomes this:

SELECT v.VictimName,
        v.YearGroupIDFK,
        v.EthnicGroupIDFK,
        v.Gender,
        v.ReligiouslyMotivated,
        v.PreviousVictim,
        v.MemberOfStaff,
        v.Child_School,
        v.Adult_School,
        v.OtherCodeIDFK
FROM dbo.tblVictims v
WHERE (v.VictimIDPK = '#recordtoget#')

Whatdoyathink?

Adrian

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Paul Swingewood
Sent: 10 May 2006 14:08
To: [email protected]
Subject: RE: [CF-Dev] Question ...


>- 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 -<

_______________________________________________

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