1. Have a field called Doc_ID on your form, Computed when composed, set to @Unique
2. Make a view with the columns ...
3. Office_IP +"-" + MachineIP (Sorted)
4. Doc_ID
5. Put the following in the QuerySave method
' This tests a key field on a view. If they match, and it's not the same document, it's an error
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim vc As NotesViewEntryCollection
Dim entry As NotesViewEntry
Continue = True
Set db = session.CurrentDatabase
Set view = db.GetView(view-name)
Set entry = view.GetEntryByKey( Office_IP +"-" + MachineIP, True )
If Not (entry Is Nothing) Then
view_id = entry.ColumnValues(1)
If view_id <> doc.Doc_ID(0) Then
msgbox "This IP was used in another document for this office"
Continue = False
End If
End If
End If
|