Hi. Got a little problem with an Access database application I'm writing. I am using VBA to create a query string. The query selects all trainees from the list who have the same field officer (by a field officer code). The list is then narrowed down to show all surveys completed by the trainee between two dates input on a form. The trainee ID's that fit the criteria are stored in a temporary table. I then want to load a listbox on a form with the trainee ID from the temp table, along with the corresponding trainee record from the trainee table (to show only the trainee records for the Field Officer that were completed in this time period). Now, the problem is that because a trainee can complete more than one (different) survey in the time period, his/her ID can be loaded into the temp table more than once. I only want to display it once. I have tried using DISTINCT in the VB query string, but this then cuts out ALL records (for some reason!). I've tried using DISTINCTROW, and this just displays all records. I've manually created a query using the same tables, and added DISTINCT before the Trainee ID, and it works fine - i.e. the query works fine, but it won't work for the listbox. Anyone know what I'm doing wrong?
Thx
Thx