I have developed a form for add new category using Ms-Access 2003 the first problem for me I got the error 3022 for no duplicating values and i have solved this one using this code:
Expand|Select|Wrap|Line Numbers
- Private Sub CategoryName_BeforeUpdate(Cancel As Integer)
- Dim Answer As Variant
- Answer = DLookup("[CategoryName]", "tbl_Category", "[CategoryName] = '" & Me.CategoryName & "'")
- If Not IsNull(Answer) Then
- MsgBox "Hi-Tech sysadmin reports that Duplicate Category Name Found, " & "Please press ok and try again. ", vbCritical + vbOKOnly + vbDefaultButton1, "Hi-Tech sysadmin, Duplicate Category Found"
- Cancel = True
- Me.CategoryName.Undo
- End If
- End Sub
so I set the categoryname field to null
I got the same error of no duplicating when I use save plus the error of null valued how can make this form for adding new category integrated
it is now 12 days to trap this error
so if anyone could provide any help for solving this please submit
thank you in advance for any help you may provide me