A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old October 29th, 2009, 11:39 PM posted to microsoft.public.access.forms
Liz O'Donoghue
external usenet poster
 
Posts: 1
Default 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  
Old October 30th, 2009, 02:51 PM posted to microsoft.public.access.forms
Klatuu[_2_]
external usenet poster
 
Posts: 53
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.