I want to base a subform on selections made in a multi select listbox on the main form.
Currently I have created a hidden field on the main form to hold an index of each of the values of the selected records from the list box and I am using this hidden field as the criteria on the query which is the recordsource of the subform.
So a user selects one or more Product Categories form the listbox and the various Products which fall into those categories should then appear in the subform. However this does not work at present. It only works when a single Product Category is selected – and even then the subform does not update immediately when the list box is updated, despite having this code in the AfterUpdate event:
DoCmd.RunCommand acCmdSaveRecord
sbfProductsList.Requery
Please can someone help me sort this out. Thank you all very much in advance
Currently I have created a hidden field on the main form to hold an index of each of the values of the selected records from the list box and I am using this hidden field as the criteria on the query which is the recordsource of the subform.
So a user selects one or more Product Categories form the listbox and the various Products which fall into those categories should then appear in the subform. However this does not work at present. It only works when a single Product Category is selected – and even then the subform does not update immediately when the list box is updated, despite having this code in the AfterUpdate event:
DoCmd.RunCommand acCmdSaveRecord
sbfProductsList.Requery
Please can someone help me sort this out. Thank you all very much in advance