This is what I am trying to accomplish: I have a table "Clients" with more than 2000 values on it, and a table "Invoice", correctly related to "Clients".
When on the "Invoice" form, the first thing I have to do is to enter the "Client". To avoid misspelling it must be through a listbox, but since I have more than 2000 clients, this is not practical. After some research I found a way to use a search box with Wildcards. So, if I type "Vand", I can narrow down to fewer clients. For example, it returns, instead of 2000 values, only "Vandeley Industries", "Lowvand Services" and "Vando Equipments".
So my first step was to create a query like this:
Code: Select all
SELECT * FROM "Clients" WHERE ((UPPER("ClientName") LIKE '%' || UPPER (:var_CL) || '%' ) OR (:var_CL IS NULL))
Then I created a table with basically one VARCHART Field. I used this table to create a new form, where the user can input a search term (like "Vand"). Plus a refresh button.
Then I created a subform based on the Query "SearchClient", with the slave field being 'var_CL'. My wish was to include a listbox in it, whose values would be those of the Query, therefore I would be able to select from fewer clients. But when I do this, I get the following error message:
The interesting thing is that if instead of the listbox I just include a table (as a subform based on Query "Search Client") everything works perfectly, showing only the few clients that contain the search term within it. The Query also works perfectly on test mode.Assert failed: S0000 Direct execute with param count > 0java.lang.Exception
at org.hsqldb.Trace.getStackTrace(Unknown Source)
at org.hsqldb.Trace.doAssert(Unknown Source)
at org.hsqldb.DatabaseCommandInterpreter.executePart(Unknown Source)
at org.hsqldb.DatabaseCommandInterpreter.execute(Unknown Source)
at org.hsqldb.Session.sqlExecuteDirectNoPreChecks(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.executeQuery(Unknown Source)
in statement [SELECT * FROM "Clients" WHERE ((UPPER("ClientName") LIKE '%' || UPPER (:var_CL) || '%' ) OR (:var_CL IS NULL))]
So this is what I tried. If anybody has a suggestion, I would be really thankful. But the main problem is this: too many entries in "Clients" to choose from. Many thanks!