reducing database calls and hooking up min/max values to main data entry view