I tried searching for solutions to my problem but I really don't know what to search for. Here is what I need to do.
I have a listbox that contains friendly names of data elements. These elements refer to larger tables of data. For example, the listbox may say "Total Hours" but when you select total hours, my listbox will report TOT_HOURS. Total Hours is the friendly name, and TOT_HOURS is the name of the field in the database.
I want the user to be able to select one of the friendly names and then run a canned crosstab query using the element they chose as the VALUE in the crosstab. So if they choose "Total Hours" they will get a crosstab report of TOT_HOURS. If they choose "Paid Hours" then they will get the same crosstab report, but this time the VALUE field will be PD_HOURS.
I have the listbox working properly but I cannot figure out how to use the returned results of the listbox as a field in a query. I understand the QBE grid a little better than SQL. But I do have an SQL string created by getting the SQL code of the query with a data element hard coded in it and replacing the data element in the hardcoded SQL with a variable representing the chosen listbox field.
So I can produce a SQL statement of the data that I want, but I don't know how to run it. I found info in the help regarding the RunSQL command but that seems to just run a SQL statement and not open a datasheet. I need to see the crosstab table of the query.
Any info greatly appreciated.
I have a listbox that contains friendly names of data elements. These elements refer to larger tables of data. For example, the listbox may say "Total Hours" but when you select total hours, my listbox will report TOT_HOURS. Total Hours is the friendly name, and TOT_HOURS is the name of the field in the database.
I want the user to be able to select one of the friendly names and then run a canned crosstab query using the element they chose as the VALUE in the crosstab. So if they choose "Total Hours" they will get a crosstab report of TOT_HOURS. If they choose "Paid Hours" then they will get the same crosstab report, but this time the VALUE field will be PD_HOURS.
I have the listbox working properly but I cannot figure out how to use the returned results of the listbox as a field in a query. I understand the QBE grid a little better than SQL. But I do have an SQL string created by getting the SQL code of the query with a data element hard coded in it and replacing the data element in the hardcoded SQL with a variable representing the chosen listbox field.
So I can produce a SQL statement of the data that I want, but I don't know how to run it. I found info in the help regarding the RunSQL command but that seems to just run a SQL statement and not open a datasheet. I need to see the crosstab table of the query.
Any info greatly appreciated.