Home » Developer & Programmer » Forms » On_UPDATE
On_UPDATE [message #150344] Wed, 07 December 2005 08:10 Go to next message
Placey
Messages: 5
Registered: December 2005
Location: UK
Junior Member
Is anyone aware of the syntax to call an On-UPDATE trigger from a when-button-pressed button?

What I basically need to do is update a record using a button, so when it is pressed it updates the record. Only problem is that I dont know how to call an On-UPDATE trigger using a when-button-pressed procedure.

Can anyone help?
Re: On_UPDATE [message #150346 is a reply to message #150344] Wed, 07 December 2005 08:14 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
I'd probably place the code of the ON-UPDATE trigger in a program unit and call that PU.


You could use the EXECUTE_TRIGGER() built-in but I don't recommend it. It messes with the trigger firing sequence.

MHE
Re: On_UPDATE [message #150350 is a reply to message #150346] Wed, 07 December 2005 08:19 Go to previous messageGo to next message
Placey
Messages: 5
Registered: December 2005
Location: UK
Junior Member
Thanks for your help.. but there is an error because you can only use On_UPDATE in a on_UPDATE trigger.. I just dont know how to call an On_UPDATE trigger using an when-button-pressed procedure.

(The error is frm-40740)
Re: On_UPDATE [message #150354 is a reply to message #150350] Wed, 07 December 2005 08:50 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
That's why I stated that you better put the logic outside the trigger, i.e. in a program unit and call that.

It would help if you could explain a little bit what you are actually trying...

MHE
Re: On_UPDATE [message #150433 is a reply to message #150354] Wed, 07 December 2005 19:18 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why do you want to call On-Update? If you want to update the database then just put an 'update' statement into the When-Button-Pressed trigger associated with a button. Remember to use 'Standard.Commit' to save the changes as the form will not sense that a change has taken place.

David
Previous Topic: doomed-please help
Next Topic: Set item value in ON-ERROR trigger
Goto Forum:
  


Current Time: Fri Sep 20 03:31:17 CDT 2024