R
rstuppi
I have a multi-select list box on a form. Each selected item in the
list will correspond to a record in the "many table" of a one-to-many
relationship.
I understand that as a result the list box is unbound.
I understand that selecting or unselecting items in the list will NOT
set the dirty flag on the form.
I understand that I have to manually update the "many table" using the
selected items in the list box.
I understand that the accepted way to mange the updates to the "many
table", according to Google search results, is via the list box's
BeforeUpdate event. So each time a item is selected or unselected I
have to update and/or delete and/or insert into the data source?
That's potentially quite a few DM operations not to mention the round
trips.
Ideally, I'd like to do the DM on the form's BeforeUpdate event.
Afterall, if the selected items in the list box have changed isn't the
form dirty? (Yes, I know, the list box is unbound.).
So far my best hack has been to do a Me.someControl = Me.someControl
in the list box's BeforeUpdate event which of course sets the form's
dirty flag. A call to Is Dirty = False throws some kind of bizzare
error that I could ignore but that seems even worse. A subform would
be ugly and in this app's situation presents other distasteful issues.
Does anyone have a better idea?
list will correspond to a record in the "many table" of a one-to-many
relationship.
I understand that as a result the list box is unbound.
I understand that selecting or unselecting items in the list will NOT
set the dirty flag on the form.
I understand that I have to manually update the "many table" using the
selected items in the list box.
I understand that the accepted way to mange the updates to the "many
table", according to Google search results, is via the list box's
BeforeUpdate event. So each time a item is selected or unselected I
have to update and/or delete and/or insert into the data source?
That's potentially quite a few DM operations not to mention the round
trips.
Ideally, I'd like to do the DM on the form's BeforeUpdate event.
Afterall, if the selected items in the list box have changed isn't the
form dirty? (Yes, I know, the list box is unbound.).
So far my best hack has been to do a Me.someControl = Me.someControl
in the list box's BeforeUpdate event which of course sets the form's
dirty flag. A call to Is Dirty = False throws some kind of bizzare
error that I could ignore but that seems even worse. A subform would
be ugly and in this app's situation presents other distasteful issues.
Does anyone have a better idea?