Hi,
I am using a Listbox to display the results of a query by means of a SQL statement. The form of the statement is:
SELECT (field1),(field2),(field3) FROM (tableX) AS (X) INNER JOIN (tableZ) AS (Z) ON (condition1) INTO CURSOR (curSample) ORDER BY (1,2) HAVING (condition2)
FIRST:
For the records in tableX with a match in tableZ the result is perfect and all items are listed accordingly; but when a record in tableX does not have a match in tableZ, that item is repeated in the Listbox as many times as the total amount of records in tableZ.
Which is the reason for this behaviour and how can I fix this situation ?
SECOND:
If I declare a Public variable in the form that contains the Listbox object and use it as part of condition2 I get the following error message: Column Not Found in SQL. The only way it works is declaring the same variable Public in the main program. Note that in both cases the variable is initialized in the Init method of the Listbox.
Why does this happen ?
Thanks in Advanced or Hope This Helps