I am working on error-proofing data entry into the database I created for fish data. I am trying to figure out how I can prevent keystroke errors on length and weight data. I plan to use an after update event in the weight field. I can use existing data to figure out the relationship between length and weight for each species (usually a power function e.g. y = 0.1111x^3.0701 for a particular species I work with). What I don't know how to do is write the code to compare the weight typed in to a range of weights expected for a fish of a certain length.
Given the above equation, a fish that is 16" long should weigh 552 grams. I need the code to say, if the fish is 16 inches long the weight should be 552 grams + or - 25%. Any suggestions?