"As
        soon as Allah created the pen, he commanded it saying:
        write. It said: "what should I write my Lord?"
        Allah said: "Write the record of all things to
        happen till the establishment of the hour" Oh my son
        I have heard Allah's Messenger (sallallahu alaihi wa
        sallam) saying: "He who dies believing other than
        this is not from me"(i.e. is not upon the prophet
        (sallallahu alaihi wa sallam) belief) (Abu Dawud)
B. The Writing Following The Creation of Aadam
Umar ibn Al-khattab was asked about the following aayah:
"And remember when your Lord brought forth
        the children of Aadam from their loins their seed (or
        from aadams loins ,his offspring) and made them bear
        witness as to themselves saying "Am I not your Lord?
        They said : "Yes". We testify lest you say on
        the day of resurrection, verily we were unaware of
        this"
(7:172).
and he said, "When Allah's Messenger was asked about
        it, I heard him say: "I Allah created Aadam and then
        he passed his right hand and brought forth from it his
        offspring saying "I have created these for paradise
        and they will do the deeds of the people of Jannah (those
        that will go to paradise), he then passed his hand over
        his back and brought forth from it his offspring saying
        "I have created these for the Hell and they will do
        the deeds of the people of the hellfire". Thereupon
        a man asked what is the use of doing any good? Allah's
        Messenger (sallallahu alaihi wa sallam) said:
        "Verily when Allah creates a slave for paradise he
        uses him in doing the deeds of the people of paradise
        until he dies doing them upon which he will enter
        paradise but when he creates a slave for the hellfire, he
        uses him in doing the deeds of those who will enter hell,
        until he dies upon doing one of their actions upon which
        he will enter helr'.(Imaam Ahmad, Abu Dawood &
        others)
Shaikh Al-Albaani commented that many people may
        understand that these Hadith indicate that man has no
        choice with respect to his deeds while there are many who
        think that being from the people from Paradise or the
        people of Hell is an arbitrary matter, or just a sheer
        luck. It is known that Allah is perfect in His Names and
        Attributes that
"there is nothing like Him" (42:11)
it is according to His Knowledge Wisdom and Justice and
        that he the exalted chose people for Paradise or for Hell
        he knew that those chosen for Paradise will obey him when
        they are commanded to do so. An those for Hell will
        disobey Allah decisions therefore it is in accordance
        with what would come of them. Belief in eemaan that
        necessitates the admittance into paradise or disbelief
        that necessitates punishment in Hell, both faith and
        disbelief are a matter of choice for mankind. Allah the
        exalted does not force anyone to adopt other choice:
"Then whosoever wills 
let him believe and whosoever wills let him disbelieve" (18:29).
Because His swt choice is All Just and All Wise.
        Therefore Allah cannot be questioned about it. (Al
        Albaani in silsilatul Ahadeeth As Saheehah)
C. The Taqdeer Allah - 'Umari: Covering the
        persons life span.
The persons livelihood, life term, deeds and his status
        in the Hereafter (wretched or blessed) are written while
        in the mothers womb at an early stage of his development.
        This is confirmed in the hadeeth related by Abdullah ibn
        Masood who said, "Allahs Messengers saw said:
        "The creation of everyone of you is collected for
        the first forty days in his mothers womb in the form of a
        nutfah after which it turns into an alaqah for an equal
        period. Then it becomes a mudgha (a lump of flesh) for a
        similar period and then Allah sends an angel with four
        words recording the persons provision, his life term, his
        deeds and whether he will be wretched or the blessed (in
        the hereafter). Then he breaths the soul into him. By
        Allah besides whom there is no true God, the one amongst
        you will do the deeds of the people of Paradise till
        there is only the distance of a cubit between him and
        Paradise but then the writings precedes and so he will do
        the deeds of the people of the fire, and thus enters it;
        and one of you will do the deeds of the people of the
        fire until there remains a cubit between him and Hell
        that the writings precedes and he will do the deeds of
        the people of Paradise, and thus enters it