I keep getting this Error message

I keep getting this Error message

Error details:
Error in executing On User Input script of the field, Items.
Null value occurred while performing Addition operation. Line:(18)


this is my script. it will be something simple i know


//Link the Item_Name field in subform to the Item_name field in Items Form;
selected_item = Items[ID = row.Item_name];
//Set the quantity of the selected product to 1 by default, if no quantity is declared
if(row.Quantity = null)
{
row.Quantity=1;
}
if(row.Quantity > selected_item.Quantity)
{
alert "Please select a lesser quantity";
}
//Set the price of the selected product as per the Products Form
row.Item_Price=selected_item.Item_Price;
//Calculate the total amount based on the Item, Item_Price and Quantity.
tot = 0.0;
for each  item in Items
{
tot = tot + item.Item_Price * item.Quantity;
}
input.Total_Amount = tot;

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方