Adding a Save (Update) button [message #571622] |
Wed, 28 November 2012 03:57 |
|
marko.trajkoski
Messages: 8 Registered: October 2012 Location: Slovenia
|
Junior Member |
|
|
Hello Everyone!
Here is my problemm..
I have one form where I have let's say 2 items that I want to manage. One is a List Item and the other Text Item. Both are based on one table. The List Item is not updatable (Update Allowed is set to NO) and there I have some types of houses for example (T -> tall house, B -> Big house, S -> Small house it's not important so much) and the Text Item is for counting the types for example we have 4 houses of type T and if we add another one in the textItem we will see 5, so it's not counter for all houses but it counts types of houses and that item is not updatable nor insertable (Update allowed and Insert allowed are set to NO) so it's only purpose is just to show how many hauses we have of particular type and automatically increases the number if we insert new house.
Beside this two items I have another Items that conatin some informations about the house (How many flats, doors, windows, and so on..).
I hope you've got the picture of my form and table.
Now I want to add one button with trigger WHEN-BUTTON-PRESSED that will do this..
If I want to change the type of the house after I inserted it and save it in the table, I have to just change the type in the List Item (choose another type) and press the button to save the same house with the same properties I would say (How many flats, doors, windows, and so on..) but with another type. First when I press the button it must ask me if I am sure that I want to make that change (I'll make an allert fot that) and if I press OK or Yes my house will be saved just with the different type and the previous house with the previous type must be erased. And in the textItem 'the counter', the number of the new type must encrease for one and the previous type must decrease for one.
I hope you understand what I want to do and all I need is that trigger to manage this problem of mine. I know it's possible to do but I am quite new in DB programming and I am not very good with programming in PL/SQL.
Please correct me if my idea of doing this is incorrect and give me some instructions.
Thank you all!
|
|
|
|
|
Re: Adding a Save (Update) button [message #571633 is a reply to message #571632] |
Wed, 28 November 2012 06:39 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Then you need to translate the column names into english for the rest of us.
It's very hard to visualize what update is required if we don't know the relationship between the datablock items and the database columns.
|
|
|
|
Re: Adding a Save (Update) button [message #571641 is a reply to message #571634] |
Wed, 28 November 2012 07:50 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Any forms trigger will make an update on the table if you write an update statement in it.
And you seemed to want to use when-button-pressed - so not sure why you're asking about what triggers to use - that would be the trigger.
Unless you want to use forms default behaviour, in which case you probably don't want the button, but instead put the required code in pre-update. Your problem description is too vague to guess what that code might be.
|
|
|
|