How to use custom selection and calculations on form