Hi There,
I use a form to add data to a table. The first field in my form (PolicyNumber) must check the entered value in the form directly from the table. *(Now it notifies me when I completed all the other fields in the form and when I ready to add this as a new record in the table).
I tried this with After Update/Before Update/Enter/Dirty events:
If IsNull(DLookup("PolicyNumber", "tblPolicies", "PolicyNumber = " & Me.PolicyNumber)) Then
'...Not found process onwards
Else
'...Opps found a duplicate number.. do some other actions..
End If
tblPolicies is the name of the table, PolicyNumber is both the fieldname in the table and the controlname in the form.
Often Im prompted with Error 2001 'You cancelled the previous operation', any ideas how I can get this working??
Thanks
I use a form to add data to a table. The first field in my form (PolicyNumber) must check the entered value in the form directly from the table. *(Now it notifies me when I completed all the other fields in the form and when I ready to add this as a new record in the table).
I tried this with After Update/Before Update/Enter/Dirty events:
If IsNull(DLookup("PolicyNumber", "tblPolicies", "PolicyNumber = " & Me.PolicyNumber)) Then
'...Not found process onwards
Else
'...Opps found a duplicate number.. do some other actions..
End If
tblPolicies is the name of the table, PolicyNumber is both the fieldname in the table and the controlname in the form.
Often Im prompted with Error 2001 'You cancelled the previous operation', any ideas how I can get this working??
Thanks