Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Data is Duplicate, just alert user

Status
Not open for further replies.

SDS100UK

MIS
Joined
Jul 15, 2001
Messages
185
Location
GB
Hi,
(AccXP)

I have a table with a CreditCardNumber field in.

This table stores data on bookings. There is a unique customer number, but this is only an internal number.

If a customer phones and places an order, what I need is for Access to check and see if this customer already exists. If so, then simply to alert the user to this and allow the transaction to continue.

Maybe if a msgbox could spring up with the record or customer number of the previous transaction.

What would be the simplest way to achieve this?

Many thanks in advance

Steven
 
Hi, the simplest way would be to use a DLookup function - on a form it would look something like
Code:
If NOT IsNull(DLookup _
    ("CREDIT_CARD_NO", "LU_CUSTOMERS", "CREDIT_CARD_NO = " & me.YourIdControlName & ")) Then
    MsgBox "Credit card number exists"
End If
LU_CUSTOMERS being your customer look up table, CREDIT_CARD_NO being the field name in that table - if its a text field then add 's into the criteria, i.e "CREDIT_CARD_NO = [highlight]'[/highlight]" & me.YourIdControlName & "[highlight]'[/highlight]))
HTH, Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top