I have an unbound listbox that I populate using an SQL statement: Me.lstIssues.RowSource = strSQL. The SQL statement works fine.
The listbox is bound to column 1 which is an unique ID. When I click on an existing row in the listbox, an AfterUpdate event is triggered, which populates a second unbound listbox using another SQL statement that shows more details surrounding the item that I clicked on.
My idea is that clicking once in the unbound listbox triggers the AfterUpdate event, which shows the details in the second unbound listbox. However, double clicking in the unbound listbox should trigger the OnDblClick event, which I would want to use to open a form in which the record can be edited.
The problem is that double clicking the selected record triggers the AfterUpdate event. If I delete the AfterUpdate event from the unbound listbox and then try to double click on a record the form actually does open.
I reckon that the AfterUpdate event is triggered before the OnDblClick event, because the contents of the unbound listbox changes (after all a new record is selected). It looks like that the AfterUpdate event (populating the second unbound listbox with an SQL statement) takes too long for the programm to handle the OnDblClick event.
Does anyone have suggestions to improve the situation and make a "single click" (or actually selecting a record) trigger the AfterUpdate event and a "double click" opening a form to edit the record that has been double clicked on?
Thanks for looking into this!
The listbox is bound to column 1 which is an unique ID. When I click on an existing row in the listbox, an AfterUpdate event is triggered, which populates a second unbound listbox using another SQL statement that shows more details surrounding the item that I clicked on.
My idea is that clicking once in the unbound listbox triggers the AfterUpdate event, which shows the details in the second unbound listbox. However, double clicking in the unbound listbox should trigger the OnDblClick event, which I would want to use to open a form in which the record can be edited.
The problem is that double clicking the selected record triggers the AfterUpdate event. If I delete the AfterUpdate event from the unbound listbox and then try to double click on a record the form actually does open.
I reckon that the AfterUpdate event is triggered before the OnDblClick event, because the contents of the unbound listbox changes (after all a new record is selected). It looks like that the AfterUpdate event (populating the second unbound listbox with an SQL statement) takes too long for the programm to handle the OnDblClick event.
Does anyone have suggestions to improve the situation and make a "single click" (or actually selecting a record) trigger the AfterUpdate event and a "double click" opening a form to edit the record that has been double clicked on?
Thanks for looking into this!