Home » Developer & Programmer » Forms » Form Update (forms 6i)
Form Update [message #324529] Mon, 02 June 2008 23:45 Go to next message
rakhatmis
Messages: 25
Registered: March 2008
Junior Member
Hi all

I am new in this world of forms. I am using forms 6i. I have a form where I am working on some DMLs.
When I enter data in text items and press save button, all the records inserted successfully. On save button there is commit_form on When_Button_Pressed trigger.
The problem is when I open the same form, search for a specific record, do modifications and press save it insert a new row in the table instead of updating the same record.
I want to update the searched record instead of inserting a new one.
Kindly help me asap
Thanking you in advance.
Re: Form Update [message #324550 is a reply to message #324529] Tue, 03 June 2008 01:58 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
I open the same form, search for a specific record, do modifications and press save it insert a new row in the table instead of updating the same record

If you've created a form using Data Block Wizard and changed NOTHING in between, this behaviour is NOT expected.

Query ("search for a specific record") will display information gathered from a database. "Modifications" of the existing record are considered as UPDATE, so - "save" will NOT INSERT a new record into a table, but UPDATE existing one.

Unless, of course, you did "something" that changed this expected, default behaviour. It might be a trigger, so - did you write any trigger? Which one? How does it look like?
Re: Form Update [message #324577 is a reply to message #324550] Tue, 03 June 2008 03:40 Go to previous messageGo to next message
rakhatmis
Messages: 25
Registered: March 2008
Junior Member
thanx for a quick reply
yes i have created the form using form wizard but what changes should i make.
under When_button_pressed triger of save button i have simply written commit_form;
kindly guide me regarding this problem
thanking you in advance
Re: Form Update [message #324592 is a reply to message #324577] Tue, 03 June 2008 04:27 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As I've said, if it is a default form (i.e. no additional code), modifying data and saving such changes will perform UPDATE, not INSERT. There's nothing to suggest (at least, I don't know what else to say).

You could, though, create testing environment for us (including CREATE TABLE and INSERT INTO sample data statements), attach the form so that we could take a look.
Re: Form Update [message #324597 is a reply to message #324592] Tue, 03 June 2008 04:43 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

What exactly u have written in when-button-pressed.

commit_form;


or just

commit;


Try with


clear_form(do_commit);


Jak

Re: Form Update [message #335382 is a reply to message #324597] Tue, 22 July 2008 00:55 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: Form Update [message #335595 is a reply to message #335382] Tue, 22 July 2008 21:48 Go to previous message
rakhatmis
Messages: 25
Registered: March 2008
Junior Member
i have solved my problem to some extent.
now i am not searching a specific record through search button instead i go to the desired record by using the next button which forms 6i provide in .fmx
but obviuosly this is not a good solution its just a way to not to stuck.
Previous Topic: timer expired example
Next Topic: Requesting for last version od oracle form 6i
Goto Forum:
  


Current Time: Wed Mar 12 01:40:00 CDT 2025