Strange problem with the Categorized View

I got a strange experienceI have a view in which first column is Categorized.documents under that category should be sorted.I have field Pdocid(suppose) should containg the first document Unique id.That should be for all All documents.

This is the Sample code iM sending

dim View as NotesView

Dim vc As NotesViewEntryCollection

Dim firstEntry as NotesEntry

Dim SecondEntry as NotesEntry

View is Set

Vc is set

If Vc.Count <> 0 Then

Set FirstEntry = Vc.GetFristEntry

FirstEntry.document.Pdocid = FirstEntry.DocUniqueId

End if

If Vc.count > 1 then

for i = 2 to Vc.count

FirstEntry = Vc.GetNthEntry(i-1)

SecondEnrty = Vc.GetnThentry(i)

If FirtEntry.Document.certNo = SecondEntry.document.CertNo Then (CertNo is the Filed That is Categerized)

SecondEntry.Document.Pdocid = Firstentry.document.Pdocid

Call SecondEntry.Document.save(True,False)

Else

SecondEntry.document.Pdocid = SecondEntry.document.DocUniqueId

call SecondEntry.Document.Save(True,false)

Next

end if

The problem is The code is Working Absolutely fine wen im Debugging line by line and it is happening inthe Application .But its is Not Happening wen im running the script in Run Mode.

Can any one help me inthis regard will be highly appreciated

My personal id is ravidaparthi@yahoo.com

Subject: RE: Strange problem with the Categorized View

Use Option Declare.

If that doesn’t solve your problem, please be more specific about what your code is doing wrong and what you would like it to do. Also, please post your actual code – copy and paste rather than retyping it. The code you have posted contains several syntax errors and other problems, and would obviously not run without errors whether or not you were in the debugger.

I don’t believe that this code is doing anything different when you debug it, but if so, we need details.