If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
After Update event does not fire when pasting multiple rows intosubform datasheet view
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? |
#2
|
|||
|
|||
After Update event does not fire when pasting multiple rows into subform datasheet view
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. "Liz O'Donoghue" wrote in message ... 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? |
Thread Tools | |
Display Modes | |
|
|