Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
350
avoiding duplicate values in a column
posted

How to avoid duplicate values in a column? is there any built functionality or else must do iteration through rows.If so in which event i can write?

Parents
No Data
Reply
  • 5
    posted

    If I have understood well your question, I found a very simple validation with the following code in the BeforeRowUpdate event:

    For i As Int32 = 1 To ugDef1.Rows.Count - 1
       If e.Row.Cells(0).Value = ugDef1.Rows(i).Cells(0).Value Then e.Cancel = True : Exit Sub
    Next

    I hope this will help you

Children
No Data