Power Forms - Suppress Form Update

BOster

BOster

Legendary Poster
I have a power edit form. I have an FC field that I use as a filter on the form. This field is also in the grid. This is also a key field.

If I have value "A" in the FC field to filter on, but I add a record in the grid with the value "B" it adds the record with value "A". Basically it uses the FC value and not the GC value. Old forms, I used to be able to configure it to use the GC value not the FC value. How do I accomplish this with Powerforms?

In the form properties, the "update on form bv" is grayed out and not checked.
I have tried putting suppress system functions on the various form events.
 
If you don't have any code that is explicitly setting the grid value to the FC value then I think you can still code around this issue. Try setting the BC value in the before Add or Update Grid Rec to DB - Before event. I think you can do a BC value = GC value or save the grid value to another column to try this assignment. At this point the BC DSTR should have the values that will be written to the DB. I have done this in other situations and it works.
 
Good idea, will try and let you know.

Am I crazy or under the old forms could you simply uncheck "update on form bv"????
 
Ok, I think that worked.

Added BC = GC to Grid's "Add Grid Rec to DB - Before" and "Update Grid to DB - Before" events.

Thanks for the help.
 
Okay I can see why this will work. But: maybe I'm missing something here, but why would you wanna have a filter with value A, and use a different value B in the grid? I can't think of a meaningful business case.
 
My problem was that I would filter on value "A" using the FC field but I wanted to insert/update using what was entered in the grid, not the FC. W/O BC=GC it uses BC=FC by default even if "update on form bv is unchecked".
 
Brian, thanx, but that wasn't my question. I fully understood your situation. What I wanted to know is: Why, in a form (no matter power or regular) with an editable grid and a filterfield in the header, you'd wanna enter values in the grid that differ from the filter-value in the header. The observation you made does not suprise me. As an example, see the Phones form (headerless detail) or the SO Detail form W4210A (header detail) to see what I mean. Those forms do not allow you to enter different Addr Nmbrs (Phones form) or Order Numbers (SO Detail form) in the grid; They both use the value from the header.
 
Ok, I understand your question. I think.

In this case the underlying table has a compound key (two fields). The FC filter field is the first field in the compound key. The nature of the data is such that they may often want to view related records based on the first part of the key (the FC field), but I don't want to stop them from entering records with a completely different key or make them enter in a group with a common FC value, save, then re-launch the form to enter the next group, etc.
 
Aight, I get it. Pretty custom thingy. As I said before, not the way it's usually used. Hence the need for that extra bit of code :)
 
Back
Top