Before Update event not working as I expect (1 Viewer)

Lateral

Registered User.
Local time
Yesterday, 23:38
Joined
Aug 28, 2013
Messages
388
Hi guys

I have a continuous form displaying a number of text boxes.

I have a text box called “txtNewPrice”.

I have some VBA code that I use to keep track of when the user manually changes the data in txtNewPrice via a module that is triggered by the “Before Update” event.

this all works perfectly when the user manually enters a value into the field. Both the old and new values are captured and written to the audit trail


I also have some VBA code attached to the double click event that performs a calculation and then updates the txtNewPrice field with the result.

The problem is that when the double click event is actioned, it appears that the “Before Update” event isn’t and I not getting the audit record written.

does anybody have an idea of how I can fix it?

cheers
Greg
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:38
Joined
Oct 29, 2018
Messages
21,494
Hi Greg. You could try to "call" the BeforeUpdate event in your DblClick event code.
 

Lateral

Registered User.
Local time
Yesterday, 23:38
Joined
Aug 28, 2013
Messages
388
Hi Dbguy.
I think I tried that and it almost worked but it was not capturing the “before” value of the field.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:38
Joined
Oct 29, 2018
Messages
21,494
Hi Dbguy.
I think I tried that and it almost worked but it was not capturing the “before” value of the field.
Oh, yeah, that would be true. I guess you could just add the same code you're using in the BeforeUpdate event in your DblClick event (with the exception of using the Old Value, of course). What does your DblClick event look like?
 

Lateral

Registered User.
Local time
Yesterday, 23:38
Joined
Aug 28, 2013
Messages
388

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:38
Joined
May 21, 2018
Messages
8,554
I also have some VBA code attached to the double click event that performs a calculation and then updates the txtNewPrice field with the result
I think this may be normal behavior since you are committing the value to the buffer. Try in in the double click, instead to set the text property of the control instead of the value property.
 

Users who are viewing this thread

Top Bottom