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;

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now