I am very new to ASP and VBscript. I have a web photo gallery I'm trying to do with a database. I have it working to the point that the user can select a category of pictures and my asp page comes up with the correct info from my database.<BR><BR>But, I have a next and previous button to cycle through the database results one at a time. They work fine until I select the previous buttons on the first image, or the next button on the last image.<BR><BR>I need to test if the user is clicking 'next' on the page with the last image and direct them back to the category selection page. How can I code these buttons for this?