Bob gave you a generic example, now for your original question
I do not want negative value in my calculation for instance

5-12= -7 what kind of VBA code can i use for not allowing negative value note that i want to use for inventory control
Please provide more details where you are using this calculation, is it on a form or in a report? The more details provided in your question, the easier it is for a specific response.