I want to access main document field in a subform

I have a document.It has a button when we click on button one subform will open in that subform i have to access the main form field.Can you please help me out regarding this.

Subject: I want to access main document field in a subform.

If you;re just using a subform on a form, (it’s the same document) they you can just reference the value of the field in the subform. For example if the form has FirstName and you want to see firstname on the subform in a field call Greetings, just enter FirstName in the value.

IF, however, the button is opening a dialog box or a seperate document. Then there are few other things that need to be considered.

Subject: RE: I want to access main document field in a subform.

Once the subform is displayed all fields on the form or subform can be accessed. Your problem might be related to the fact that if you are loading a Computed Subform the formula is only calculated during the Forms QueryOpen. I have written an agent that gets the handle to the UIDoc closes the UIDoc the reopens it from the handle. This causes the Computed Subform to be recomputed. Depending on your form generally the user hardly notices that there was a brief flash as the document closed and then reopened.