|
Public Function unic12(fild, tabl, nam) Dim db As DAO.Database Dim rst1 As DAO.Recordset Set db = CurrentDb Set rst1 = db.OpenRecordset("select [" & fild & "] from [" & tabl & "] where Cstr(_)='" & nam & "' ;") If rst1.RecordCount <> 0 Then rst1.MoveFirst Do While Not rst1.EOF r = r & "=" & rst1.Fields(fild) rst1.MoveNext Loop unic12 = Trim(r) Else unic12 = "" End If rst1.Close Set rst1 = Nothing End Function