Home » Developer & Programmer » Forms » COMMIT PROBLEM
COMMIT PROBLEM [message #231634] Tue, 17 April 2007 15:33 Go to next message
dmack
Messages: 42
Registered: March 2005
Location: TNT
Member
Hi All
I have been checking the various threads with regards to this problem and they did provide some insight however none of them addressed my problem sufficiently. I have a form with two fields. however the user is only allowed to save data populated by one of these fields not both i.e. either OR (the corresponding code prohibits this on the When_button _pressed trigger).

If the user should exit the form however
the message : "Do you want to save the changes you have made" comes up, as it is supposed to,because the form status has changed the problem is, if the user says yes the data is saved to the database anyway. this should not happen.

Can anyone offer advice on how to get around this.
Re: COMMIT PROBLEM [message #231662 is a reply to message #231634] Tue, 17 April 2007 23:36 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
are u receiving any error
Re: COMMIT PROBLEM [message #231778 is a reply to message #231662] Wed, 18 April 2007 07:03 Go to previous messageGo to next message
dmack
Messages: 42
Registered: March 2005
Location: TNT
Member
There was no error, the form prompted me as it was supposed to. However While I restricted the user from saving both records simultaneously using the trigger, they are able to get around this by closing the form and when prompted save changes are allowed to by saying yes. How can I avoid this, I thought about a database trigger but this should be my last resort any suggestions please
Re: COMMIT PROBLEM [message #231900 is a reply to message #231778] Wed, 18 April 2007 15:23 Go to previous messageGo to next message
Littlefoot
Messages: 20894
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"Closing the form" fires the KEY-EXIT trigger. Try to put such a code into this trigger and see how it behaves:
EXIT_FORM(NO_VALIDATE);
Re: COMMIT PROBLEM [message #232181 is a reply to message #231634] Thu, 19 April 2007 13:59 Go to previous messageGo to next message
dmack
Messages: 42
Registered: March 2005
Location: TNT
Member
Thank You! Your suggestion worked fine..
Re: COMMIT PROBLEM [message #232271 is a reply to message #232181] Fri, 20 April 2007 00:09 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Aaahhh!! When the user places data in a field block the other field and that way they can not PUT data into both fields! Alternatively, have a validate trigger on the items and the block so that it fails when there is data in both fields! This sort of ssituation needs to be caught way before you get around to commiting the data.

David
Previous Topic: Use ocx
Next Topic: how to implement “OCIPasswordChange() ” in forms?
Goto Forum:
  


Current Time: Mon Dec 05 08:28:20 CST 2016

Total time taken to generate the page: 0.21004 seconds