Form QueryOpen Event

I get the following Error when this code excutes in the QueryOpen Event,

“Property or Method is not available during QueryOpen : FieldGetText”

This is the code I am trying to excute.


Dim s As New NotesSession

Dim db As NotesDatabase

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim xUser As String



Set db = s.CurrentDatabase





xUser = source.FieldGetText("PUser2")

Please let me know if you have ideas on how to solve this problem.

Thanks

Subject: Form QueryOpen Event

The QueryOpen-event fires before the document is opened ont the screen, thus there are no visible fields to jump to.

Put your code in the PostOpen-event.

Subject: Or if you have to use the QueryOpen event…

Dim doc As NotesDocument	Set doc = Source.Document

xUser = doc.PUser2(0)

Subject: RE: Or if you have to use the QueryOpen event…

Thank You