Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Joanie am 13.06.02 - 14:09:26
-
Hi,
ich hab nen Zähler, den ich jetzt gerne folgendermassen verändern würde:
zu meiner normalen Ziffer soll der Monat hinzugefügt werden, z.B.
bekomme ich normalerweise die Zahl 5 ausgegeben, jetzt aber möchte ich 06-5 stehen haben, wobei 06 für den Monat Juni steht!
mit jedem neuen monat soll der zähler wieder von vorne beginnen.
der programmcode ist nicht lange und steht in der querysave:
Dim session As New Notessession
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim doc As Notesdocument
Dim uidoc As NotesUIDocument
Dim test As Variant
Set db = session.Currentdatabase
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
If Not doc.IsNewNote Then
Exit Sub
End If
Set doc = db.GetProfileDocument("DBProfile")
test = doc.GetItemValue("Nummer")
nummer = Val(test(0))
nummer = nummer + 1
doc.Nummer = Str( nummer )
Call doc.save(True,True)
Set uidoc = ws.CurrentDocument
Call uidoc.FieldSetText( "Nummer_F",Str(nummer))
Hoffe, das mir jemand helfen kann!
Thx,
Ulrike
-
Hallo!
Das sieht aber sehr durcheinander (paar Zeilen überflüssig) aus....
Ich habs mal versucht, was Du meinst.....
Dim session As New Notessession
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim doc As Notesdocument
Dim uidoc As NotesUIDocument
Dim test As Variant
Set db = session.Currentdatabase
Set uidoc = ws.CurrentDocument
If Not doc.IsNewNote Then
Exit Sub
End If
Set doc = db.GetProfileDocument("DBProfile")
nummer = doc.nummer(0) + 1
profilmonat=doc.monat(0)
monat=Month(Today)
If monat > profilmonat Or monat < profilmonat Then nummer = 1
If monat < 10 Then
txtmonat="0"+Cstr(monat)
Else
txtmonat = Cstr(monat)
End If
nummer_f = txtmonat+"-"+Cstr(nummer)
uidoc.FieldSetText "Nummer_F",nummer_f
doc.monat=monat
doc.Nummer = nummer
Call doc.save(True,True)
Achte aber darauf, daß Nummer und Monat Zahlenfelder in Deinem Profildokument sind.
Schöne Grüße aus Friesland