OLE Object & BeforeUpdate

sapka

Board Regular
Joined
Nov 9, 2009
Messages
110
What I am trying to do is to catch when OLE Object (Picture) inside the form is updated/deleted. Unfortunately, BeforeUpdate works not as expected.
1) When I delete picture, it fires correctly.
2) When I add picture, it fires only when I switch to next record.
3) When I add replace picture, it fires only when I switch to next record.

I want to capture event just before I make 2nd or 3rd action, not after I switch to next record. How can I do it?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi,
Use the Dirty event to capture changes to the form. The before update event won't fire until the form is updated (meaning, committed to the database). It may also be possible to use a control event (such as a change event for the control that has the picture) - that would be more precise, as the Dirty event will fire when any change is made to any field in the record. The control BeforeUpdate event (not the form beforeUpdate) is another possibility - the thing is that it won't fire until the user exits the control, so it doesn't necessarily fire as soon as you make a change but only (as with the form before update) when the change is committed to the control, which is typically when the user tabs or clicks to something else on the form.

ξ
 
Last edited:
Upvote 0
I was not clear in my post. I was using Bound Object Frame's (OLE Object, picture) BeforeUpdate, not for Form's BeforeUpdate.
Dirty event works only when image is added (using CTRL+C & CTCL+V method) for the the first time. When image is updated or deleted that event is not triggered.
You was right about BeforeUpdate event not firing until user exists control. When user does that, event is triggered in all three situations (add, delete and change). But I want it to trigger without control loosing focus.

I am trying to implement the following code:
Code:
If MsgBox("Do you want to add/remove/change picture?", vbYesNo + vbQuestion, "Picture") = vbNo Then        
        'Cancel = True
        'Me.Undo
End If
Unfortunately, it does not seem to work for example in situation when existing image is replaced by a new one.
 
Upvote 0

Forum statistics

Threads
1,207,093
Messages
6,076,544
Members
446,212
Latest member
KJAYPAL200

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top