I am making a database for Drawings Duplication Check. Fields are given below
DRAWING it is Numeric SheetFrom it is Numeric
SheetTo it is Numeric
Suppose Drawing Number is 500 and Sheet From 1 is already entered...... if I try to enter same data it gives me Duplication Message.
But Drawing Number is 500 and Sheet From is 2 ... it again gives me Duplication error and then stuck the cursor. I want it to continue Data Entry and give me Duplication Message only if Drawing Number and Sheet From is SAME. Code is below
*****************************
Expand|Select|Wrap|Line Numbers
- Private Sub Form_BeforeUpdate(Cancel As Integer)
- Dim dwgNo, FromPg As String
- Dim stLinkCriteria As String
- dwgNo = Me.Drawing.Value
- FromPg = Me.PAGEFROM.Value
- If IsNull(Me.Drawing) Then
- MsgBox "Please Enter Drawing Number. This field can not be empty" & vbCrLf & _
- " ", _
- vbCritical, _
- "Canceling Update"
- Me.Drawing.SetFocus
- Cancel = True
- End If
- If DCount("[Drawing]", _
- "Drawings", _
- "[Drawing]='" & Me.[Drawing] & "'") > 0 Then
- MsgBox "Alert . ***** This Drawing Number is already Exist" & vbCrLf & _
- " ", _
- vbCritical, _
- "Canceling Update"
- Cancel = True
- End If
- End Sub
Thanks in Advance
irsmalik