Hi Yashvir,
If the OnLoad is not being called for the form and you need it to be, then you should be able to simply call it yourself from the other form.
From what I understand it you simply took the FormCode.cs file from another form and included it as a resource file in a new form. If so, this new form will not call OnLoad or any of the other event handlers for that matter. In this case, you will need to initialize the variable in some other fashion, such as a Init() method.
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge