*greetz* @ ALL!
Ich habe in der Suche nichts gefunden, deswegen Poste ich mal mein Problem:
Ich möchte eine "Mitgliedsnummer" automatisiert vergeben. Habe dafür im Querysave folgendes Script erstellt:
| 'Vergabe der Mitgliedsnummer |
| '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| Sub Querysave(Source As Notesuidocument, Continue As Variant) |
| |
| Dim workspace As New NotesUIWorkspace |
| Dim sess As New notessession |
| Dim uidoc As NotesUIDocument |
| Dim doc, docnext As NotesDocument |
| Dim View As NotesView |
| Dim choice As String |
| Dim db As notesdatabase |
| |
| Set db=sess.currentdatabase |
| Set uidoc = workspace.CurrentDocument |
| |
| If uidoc.IsNewDoc Then |
| |
| Set View = db.getview("(NachNr)") |
| Set doc = view.getfirstdocument |
| |
| If Cint(doc.MitglNr(0)) > 1 Then |
| uidoc.fieldsettext "MitglNr", "1" |
| Exit Sub |
| End If |
| |
| If doc Is Nothing Then |
| uidoc.fieldsettext "MitglNr", "1" |
| Exit Sub |
| End If |
| |
| While Not doc Is Nothing |
| |
| Set docnext = view.getnextdocument(doc) |
| |
| If docnext Is Nothing Then |
| uidoc.fieldsettext "MitglNr", Cstr ( ( Cint(doc.MitglNr(0)) +1 ) ) |
| Exit Sub |
| Else |
| If Cint(docnext.MitglNr(0)) - Cint(C) <> 1 Then |
| uidoc.fieldsettext "MitglNr", Cstr ( ( Cint(doc.MitglNr(0)) +1 ) ) |
| Exit Sub |
| End If |
| End If |
| |
| Set doc = docnext |
| |
| Wend |
| |
| End If |
| |
| End Sub |
Habe bei den Declarations folgendes stehen:
| Dim uidoc As notesuidocument |
| Dim db As notesdatabase |
| Dim doc As notesdocument |
| Dim doc_save As notesdocument |
| Dim view As notesview |
| Dim item As NotesItem |
| Dim dc As NotesDocumentCollection |
| Dim Str_Suchdoc As String |
| Dim Str_Suchuidoc As String |
| Dim SaveFlag As String |
Das Feld "MitglNr" ist ein Zahlenfeld (Berechnet), auch als Textfeld (Berechnet) funktioniert das nicht!
Die Nummer 1 vergibt er, alle anderen bekommen die Nummer 2! ;-(
Sehe ich vor lauter Bäumen den Wald nicht mehr? Oder was habe ich Übersehen.