In program design, we break the overall task into sub tasks. These subtasks are implemented using procedures. Each procedure should carry out one sub task.
A procedure is simply a way of performing code 'out of line'. When a program encounters a call to a procedure, it suspends its current path through the code statements and passes control to a separate chuck of code. When this separate chuck has been executed, control returns to the statement immediately following the call:
All procedures consist of a header that indicates the procedure name and any information that it requires
Body that performs the task
If a procedure is to be used by a number of different forms it should be declared as Public within the code module otherwise it should be declared as Private in the general declaration section of the form.