I have a listbox on one of my forms which is populated by an SQL query that I build in code. The query can be reasonably complex with a few fields, many joins and where conditions. The main table selected from is the Agency table (40 odd fields) but there are joins to five other tables to match the possible search criteria. I am using totalling in the query (ie Group by, first etc).
Once the listbox is populated, I want to use the list of selected Agencies as a select list for reports and table edits.
If I use the Select statement or WHERE statement that I generate, I find it very confusing and limiting - having to use FirstOF.. instead of field names etc limits the way I can utilise the form or report.
Is there some way that I can capture the Agency ID's produced by my original query and pass that alone to a report or form?
Hope someone there is not confused by my explanation.
Thanks in advance.
Once the listbox is populated, I want to use the list of selected Agencies as a select list for reports and table edits.
If I use the Select statement or WHERE statement that I generate, I find it very confusing and limiting - having to use FirstOF.. instead of field names etc limits the way I can utilise the form or report.
Is there some way that I can capture the Agency ID's produced by my original query and pass that alone to a report or form?
Hope someone there is not confused by my explanation.
Thanks in advance.