Situation:
I have a button that initiates a function that builds a table as arguments for a sql query.
(Let´s say that it is a row of buttons: Car, airplane and boat.)
When you click on Car you get red, green and white car to choose from. (At this point i have initiated the function for choosing an argument for the sql query). Here comes my question: I like to have a Back-button that abort/ terminates the query and goes back to the previous set of images again (Car, airplane and boat).
Anyone knows an alternative way to break out of the block of code and return it to the previous state?
I like to have the choice to either click back (and not choose from red, green and white car) or if the user actually like to choose one of the colours.
The code is fairly complex and there is much going on at this point in the code. 
the error I get is very vage, it just points to a problem with the table that is about to be sendt to the sql query and it is here I like to abort and go back.