Sunday, January 15, 2017

Check for duplicates


In the sales, purchases... forms, you want to avoid keying in duplicate entries. However, ms access does not afford you a simple method to stop an input in forms.

You have to create a count query and add it as a subform.

To check for duplicates, you will add in an event

If (Forms![Frm_tmp_arrecptmain]![Tmp_arrecdup subform].Form![CountOfReceipt_No]) <> 0 Then
MsgBox "Duplicate number, please enter new number", vbCritical, "Profit 2017"
DoCmd.GoToControl "Bank_value"
DoCmd.GoToControl "Receipt_no"
End If

No comments:

Post a Comment