Hi Pari,
The main form, is the main document form.
In your case i believe is the oForm.
The UDFFormUID will be blank if the UserDefinedField form is not opened on screen.
So before you get this value, you need to make sure the UDF Form is opened.
Regards
Edy