After Update event does not fire when pasting multiple rows intosubform datasheet view

L

Liz O'Donoghue

I have a subform in datasheet view that consists of a combo box, a
checkbox and 12 numeric fields. Subform is linked via a uniqueid to
the record of the parent form.

I've added code to the After Update event of the combo box which uses
the DLookup to pull a "default" value for the checkbox based on what
is selected in the combo box and set the value of the checkbox to the
default value. The user then has the option to "customize" the value
of the checkbox (sometimes they need the option to override the
checkbox).

This all works great until a user pastes *multiple rows* of "related"
data into the subform datasheet. The users generally copy and paste
from Excel. It appears the AfterUpdate event is firign for the
combobox in each row that is pasted (when i fire a msgBox for each
row, a msgbox pops up for each line pasted and can return the default
lookup value).

However, the value of the checkbox is not then updated based on the
data entered in the combobox.

Any ideas on how to get around this issue?
 
K

Klatuu

Pasting data from an external source is never a good idea. First, you can't
easily validate the data. For one thing, no events fire when data in
appended that way. Form events fire only when data is entered in the form
controls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top