I have some code in the PostOpen event of a summary form that looks at a view for documents. I get all the documents in the view that are related to the summary form and load their values into different fields in the summary form. The code in the PostOpen even looks like this:
Set doc = Source.Document
Set view = db.GetView(“Search”)
Call view.Refresh
Set vc = view.GetAllEntriesByKey(keyvalue)
Set firstItem = doc.GetFirstItem( “firstField” )
Set secondItem = doc.GetFirstItem( “secondField” )
firstItem.Values = “”
secondItem.Values = “”
Call doc.Save(False, False)
I always reset the values of the firstItem and secondItem fields to blanks before doing anything else. But, when I process the rest of the code that assigns values to these fields, I always get old values instead of the values from the documents in the view. I have to close the document and reopen it to see the updated information. What am I missing?