,louts C/S 中如何判断某个域值在数据库中是否重复

请教各位大虾,louts C/S 中怎么判断某个域值在数据库中是否重复?
请教各位大虾,louts C/S 中怎么判断某个域值在数据库中是否重复?如果重复就不让输入

------解决方案--------------------
如:字段Model 型号不能重复. "ViewModel "是一个View, 首列是排序列Model

在字段的Existing事件中,

Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim curdb As NotesDatabase
Dim view As notesview
Dim key,ViewModel As String
Dim uidoc As NotesUIDocument
Dim doc As notesdocument
Set curdb = session.CurrentDatabase
Set uidoc = ws.CurrentDocument
key=uidoc.FieldGetText( "Model ")
Set view=curdb.GetView( "ViewModel ")
Set doc = view.GetDocumentByKey(key,True)
If not doc Is Nothing Then
Msgbox( "请注意:型号为 "+key+ "已存在,不能再使用,请输入新型号. ")
Exit Sub
End If
End Sub