Hi all
So previously I had a form with a combo box that when the user selected an item, a report would open displaying all the records that carried that field item (in this case, agencies that use a particular program code). It worked nicely, however now I need to allow the user to make multiple selections and I know a combo box doesn't allow multiselections however I added a listbox and it's record source is the query that links the two tables together (tblAgencyInformationNew and tblProgramCodes).
I enabled the multi select property to simple on the list box but my question now is, does anyone know the vba or can point me to some good examples of how this can be accomplished? I was told that an IN CLAUSE could be of use and looking at examples but so far nothing has really helped. You guys are great and any feedback is appreciated!
So previously I had a form with a combo box that when the user selected an item, a report would open displaying all the records that carried that field item (in this case, agencies that use a particular program code). It worked nicely, however now I need to allow the user to make multiple selections and I know a combo box doesn't allow multiselections however I added a listbox and it's record source is the query that links the two tables together (tblAgencyInformationNew and tblProgramCodes).
Code:
SELECT DISTINCT qryAgencyProgramCodes.ProgramCode, qryAgencyProgramCodes.ProgramName
FROM qryAgencyProgramCodes
ORDER BY qryAgencyProgramCodes.[ProgramCode];
I enabled the multi select property to simple on the list box but my question now is, does anyone know the vba or can point me to some good examples of how this can be accomplished? I was told that an IN CLAUSE could be of use and looking at examples but so far nothing has really helped. You guys are great and any feedback is appreciated!