Problem with upgrading from R5 to R6 client

I upgrade my Notes client from R5 to R6.0 today. The database is on R6 server. It works well with R5 client before. Now when I open my document I get “variable not contain an object” error message. I traced the errors and found that the CurrentDocument property of NotesUIWorkspace is empty. Here is the code behind the problem field: Set session = New notessession

Set workspace = New NotesUIWorkspace

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document

Please help. Thank you in advance.

Subject: Where is the code? QueryOpen, PostOpen?

Subject: RE: Where is the code? QueryOpen, PostOpen?

Hi Bill,The code is in the Initialize function associated with a text field, rather than in QueryOpen or PostOpen. I use it to implement some special functions for the field. It works well with R5 client. My colleagues have no this kind of problems using R5 currently. Thx.