Barney's suggestion should work... as an alternative suggestion, you could either use ListFindNoCase() against the cfdirectory's name column to locate the current image:
<cfset index = ListFindNoCase(ValueList(cfdirectory.name),url.image)> And then use "index" to locate the next and last images in that cfdirectory query. Or you can pass the index of the image in that query to the page and omit the listfindnocase() statement all-together. When you have the index of an image you can easily get the names of the next and last images in the directory using cfdirectory.name[index+1] and cfdirectory.name[index-1] or compare against cfdirectory.recordcount to know if the current image is the last one in the directory. You do need to make sure you use a sort order in the cfdirectory tag, as cfdirectory will produce semi-random results otherwise. s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:210446 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54