1

Тема: Проверка на уникальность поля в базе

Sub Querysave(Source As Notesuidocument, Continue As Variant)
    Dim session As New NotesSession
    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
   
    Set db = session.CurrentDatabase
    Set uidoc = workspace.CurrentDocument
   
    Set view = db.GetView("(townstreet)")
   
    quote = "FIELD Bmesto CONTAINS " & Source.FieldGetText("Bmesto") &" AND  FIELD Bstreet CONTAINS " & Source.FieldGetText("Bstreet")
    j = view.FTSearch(quote, 0 )
    If j >0 Then Messagebox "Такая улица уже есть ", MB_OK, "Внимание": Continue = False
End Sub

Поделиться