Hello everyone,

I have a project that the user can create/customize a report in a form,.. And in my project I have a form where user can choose a multiple tables, and also user can choose which fields they put in the report form...............,

but the main problem is only "One Table" allow in the report,... so I have a plan that I make a SQL Query using a text box for querying a multiple tables at a time,... any help or suggestions what I do???

example: Like crystal reports, their is an option that the user can also create a query condition into a text box..... that's what I want to do..............................

Thank you in advance.........!
Any Reply is appreciated..........!

Oscar Resonable

Well, it sounds like you have a plan but to execute it you are going to need to write some code and depending upon which way you go depends upon how much code you will have to write. Now if you trust the user to create a properly formatted SQL string then it should be easy as they would type it into the text box, hit execute (click command button), and you would execute the string, and hopefully be able to handle any errors that may arise.

Now, if you don't trust the user (like me) to properly format a query string, then you have a bit more coding to do. I would suggest that you create a form that contains your db schema on it and allow the user to select the fields that they want in the report. Then you analyze those fields that the user selected and build the query string yourself before you execute it.

Good Luck