I have a form with two listboxes, two subforms and two pictureboxes.
1) The first listbox is populated via the row source in it.
When I mark a row in the listbox one subform show detail information and one picturebox show a linked picture.
I use the listbox After_update to populate the picturebox.
This works fine.
2) The second subform is linked to a textbox which is drawing the value from the listbox. The column in the subform is a foreign key, so I get a number of rows in the subform.
This works fine.
3) I have a textbox taking a value from the second subform. This textbox is used in the query populating the second listbox as a criteria.
When I mark a row in the second subform I want the second listbox to show values reflecting this.
To do this I have a requery in the second subforms event On current. I do the requery on the second listbox.
Here is the problem: A loop is started and the On current event is run over and over again.
I can not understand why because I do not trigg the On current event in the code, I do the requery on the listbox which is placed in the main form.
4) The last thing is that when I click on a row in the second listbox the second picturebox is populated.
This works fine except for that the loop is removing the picture from the second picturebox. (When I click on another row in any form or list the pictures are removed.)
I know this sounds a bit complicated but I have tried to keep the structure strait forward.
I upload the file (Access 2007) together with some picture files used in the example, and hope someone can tell me where I go wrong.
There is also a textfile with short instructions.