Sequential Numbering for each year

Hi,

I’m trying to add sequential numbering to my application. I already have a script which works fine in the QuerySave event.

I need to get the counter to reset to 0 at the beginning of each year.

This is the script that I’m using now:

Dim s As NotesSession

Dim w As NotesUIWorkspace

Dim d As NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim doc2 As NotesDocument

Dim v As NotesView



'declaring other variables

Dim keepreqno As Integer

Dim reqno As Variant

Dim keepyear As Variant



'initializing the variables

Set s = New NotesSession

Set w = New NotesUIWorkspace

Set d = s.CurrentDatabase

Set uidoc = w.CurrentDocument

Set v = d.GetView("Sequence Numbers")

Set doc = v.GetFirstDocument

Set doc2 = uidoc.Document



If Not(doc Is Nothing) Then

   If uidoc.IsNewDoc  Then

      keepreqno = doc.SNNumber(0)

      keepreqno = keepreqno + 1

      doc.SNNumber = keepreqno

      doc2.storereqno = doc.SNNumber(0)

 	      Call doc.Save(True,True)

		

		

      keepyear = doc2.storeyear(0)

          keepreqno = doc2.storereqno(0)

          doc2.rfstorereqnum = Str$(keepyear) + "/" + Str$(keepreqno)

		

      Call doc2.Save(True,True)	

     End If

End If

Much Thanks!

Subject: Sequential Numbering for each year

So what’s your question? Do you want someone else to code it for you or are you asking how others would do it? If you have a specific question please post so the rest of us can try and help you a little better…