I have a form where i enter products, quantity, price. you can enter up to 8 products (it's ok) I have a button to update the quantities and calculate the the total price.(cmdUPDATETOTALS)
simple code. TotalQuantity = quantity1+quantity2, etc. TotalPrice = price1*quantity1+price2*quantity2, etc.
After form load, if i hit the cmdUPDATETOTALS with no values present, nothing happens. which is fine. If i enter data and hit the cmdUPDATETOTALS, it does the calculations fine.
I have other buttons to either cmdCLEARALLPRODUCT data or I can clear individual products with cmdCLEARPRODUCT1. these set the fields to "". example: me.quantity1 = ""
after I use either commands to clear the data, i start getting "runtime error 13, type mismatch" when I click the cmdUPDATETOTALS. this happens if any of the product fields are empty. if i just cleared product1, then entered new data into product1, its fine. if i clear product1 and product2 and only enter new data into product1, i get the error.
i dont get it. on form load, all of these values are set to ="", so why would clearing the data and setting it back to ="" cause a type mismatch error?
thanks.
simple code. TotalQuantity = quantity1+quantity2, etc. TotalPrice = price1*quantity1+price2*quantity2, etc.
After form load, if i hit the cmdUPDATETOTALS with no values present, nothing happens. which is fine. If i enter data and hit the cmdUPDATETOTALS, it does the calculations fine.
I have other buttons to either cmdCLEARALLPRODUCT data or I can clear individual products with cmdCLEARPRODUCT1. these set the fields to "". example: me.quantity1 = ""
after I use either commands to clear the data, i start getting "runtime error 13, type mismatch" when I click the cmdUPDATETOTALS. this happens if any of the product fields are empty. if i just cleared product1, then entered new data into product1, its fine. if i clear product1 and product2 and only enter new data into product1, i get the error.
i dont get it. on form load, all of these values are set to ="", so why would clearing the data and setting it back to ="" cause a type mismatch error?
thanks.