Easy to Create, Easy to Change - Easy to use!


2 times SetValue on a Button


Started by grohmann.papier@t-online.de
Search
You will need to Sign In to be able to add or comment on the forum!

2 times SetValue on a Button

Hallo Dataease Forum,

have a little problem: 

Code like this on a Button:

SetValue("MaterialVS",Typ) + SetValue("Preisqm",VK_Preis)

This Button is inside a Subform. The Fields are listed in this Subform and i want to take it over into the Mainform.

Now , only the first "SetValue " funktion works and the second one makes nothing.

Interesting is that if i change the order of the SetValue funktion the error will change too ! :)

Any idea for this ?

Kind regards Markus

Written by grohmann.papier@t-online.de 12/12/15 at 16:32:22 Dataease [{8}]FIVE

Re:2 times SetValue on a Button

My guess would be that the field that doesn't work have a different Object name i.e. you have renamed the field.

Object names is the same as the Field name on fields as long as you don't change the field name. 

Object names and Field names is not the same for a very good reason and that is that it is very practical to be able to change the object name.

If you have field OrderNr in Mainform and then you have OrderNr in subform, they will have the same Object Name (and field name).

Field name doesn't matter as that is in a different order, but the object name matters as you have a top down approach to object names i.e. they are all the same the only thing that gives the order (and priority) is left to right/top to bottom on the form 1 pixel at a time

You can of course address the second OrderNr using # but that is not practical if  you are to address the rows inside the Subform indepentently

So best practice is than for instance to rename the OrderNr on the subform to SbOrderNr then the first "clone" will be SbOrderNr#1 and the 10 row in the subform will be SbOrderNr#10.

Written by DataEase 12/12/15 at 19:35:06 Dataease [{8}]FIVE