Ensuring only one commission per product in Access Table

P

PVANS

Good afternoon,

Please can someone help me.

In my Access Database I have a table called tblCommission, with the fields:
Commission_ID;Client_account; Product_code; Commission; Exchange (£ or $)

I need a method to ensure that each client can have a commission set for
every product - but that a client cant have to commission's for one product:

eg: I need a method to prevent this:
Comm_ID Client_account Product_code Commission Exchange
1 000001 Coke 3 $
2 000001 Coke 2 $

Does anyone have any suggestions?

I am quite new to Access and completely stuck with this.

Further infor:

Client_Id is related to my Client_ID in a tblClients
Product_Code is related to my Product_Code in a tblProducts

Really appreciate any help. Thanks in advance

Paul
 
K

Keith Wilby

PVANS said:
Good afternoon,

Please can someone help me.

In my Access Database I have a table called tblCommission, with the
fields:
Commission_ID;Client_account; Product_code; Commission; Exchange (£ or $)

I need a method to ensure that each client can have a commission set for
every product - but that a client cant have to commission's for one
product:

eg: I need a method to prevent this:
Comm_ID Client_account Product_code Commission Exchange
1 000001 Coke 3
$
2 000001 Coke 2
$

Does anyone have any suggestions?

I am quite new to Access and completely stuck with this.

Further infor:

Client_Id is related to my Client_ID in a tblClients
Product_Code is related to my Product_Code in a tblProducts

Hi Paul.

One way would be to make a composite primary key from the Client_account and
Product_code fields.

Keith.
www.keithwilby.co.uk
 
K

KARL DEWEY

It does not need to be the primary key field but just a composite index from
the Client_account and Product_code fields and set to unique.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top