# Inheritance: setting base for variables in the sub form

**URL:** <https://forum.servoy.com/t/inheritance-setting-base-for-variables-in-the-sub-form/16163>\
**Category:** Classic Servoy\
**Created:** [July 9, 2012, 3:22pm UTC](https://forum.servoy.com/t/inheritance-setting-base-for-variables-in-the-sub-form/16163 "2012-07-09T15:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fgsmartest](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fgsmartest](https://forum.servoy.com/u/fgsmartest)\
**Post date:** [July 9, 2012, 3:22pm UTC](https://forum.servoy.com/t/inheritance-setting-base-for-variables-in-the-sub-form/16163/1 "2012-07-09T15:22:22Z")

</div>

hi,

i am setting the base form form variables in the child form but it doesnt seem to be reflecting. any help?

---

<div class="post-metadata">

**Author:** ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.servoy.com/u/omar)\
**Post date:** [July 9, 2012, 3:54pm UTC](https://forum.servoy.com/t/inheritance-setting-base-for-variables-in-the-sub-form/16163/2 "2012-07-09T15:54:26Z")

</div>

When working with inheritance (or with objects in general) it is best practice not to change form variables/properties directly but rather implement a method to change them. That way the responsiblity for internal changes stay within the object itself and dependencies can be avoided as much as possible. Also when you define a method to change the value you have the choice of overriding the method in the child form.

Anyway to simulate your problem, I made a simple example with a parent form with a numeric form variable in it (with a default value of 0) and subclassed it. In the onLoad of frmChild I set the formvar to 1 and that worked just fine. Maybe you can elaborate on what you want to achieve?
