Hey,

Are you familiar with how to debug your application? As sap says, you should set a breakpoint in your code, and then step through it to see exactly what is assigned to the selectSQL variable, and what line throws the error.

In addition, it looks to me like the query you are assigning is the same in each case. Is that what you intended?

Would it not make more sense for you to use a parameter within your SQL query, which you could set, based on what the user puts into the textbox.

Gary