Need help with my form(drop-down lists, calculating EOQ and saving)

Hello,
I am university student at Turkey and i am trying to learn about tables forms and X++ for my thesis,
I want to create a basic form which has some basic elements, i will try to explain it here.

Here is the main layout , i will explain with the numbers;
1 is like a drop-down list with 2 different values like this ;

They will be my item name and item no ,

2 is my stock on hand . Thats the value it will take from a table called StockValues
3 is Critical point ; if critical point is higher than my stock on hand , then the program will give a warning that i should order that item.

4 is the calculate button. it will open up a new page and it will calculate the critical point.

Here is the new opened page i am thinking ;

5,6,7 are the values needed for the critical point formula, again they will be taken from StockValues Table.

8 is a selection between , calculating the crtitical point with EOQ formula , and entering manually,

9 is result area, if we select to use the formula , this area will be locked and it will show the result of the formula which is “sqrt(2xDxS/H)” (D S and H is the values from numbers 5 6 7 ) and if we select the second option , the area wont be locked so that we can enter the value as we like.

10 is the saving and exit button. when pressed it will save our critical point in background and if the critical number is bigger than our stock in hand , a warning will show up .

This is the general idea in my mind. I know its not very hard to do but i am really confused about using methods(codes) inside a form. I would be so glad if you help me on here or email me. Thanks !