Thanks for your post.
I'm afraid I'm not too sure what you mean by 'changing the format' of CODE.
The 'CODE' field in the patient record screen is already configured to automatically count upwards as you add new patient records to your database. The field simply works by looking for the highest patient code value in the database, and then adds 1 to it.
(1, 2, 3, 4... OR 6547, 6548, 6549 etc...)
Do you mean you want 4 zeros to appear before the figure? (00001, 00002, 00003...) If so then unfortunately this is not possible as the field is numeric. Even programs like Microsoft's Excel do not allow this and would shorten 00001 to 1.