J
Jack Sheet
Hi all
Access 97
I have two tables: T_Clients and T_Tasks.
They share fields ID_Clients and Ref
ID_Clients is the primary key in T_Clients, and is formatted as autonumber
in T_Clients
In T_Tasks, ID_Clients is formatted as a long integer.
There is a one to many relationship between T_Clients.ID_Clients (one) and
T_Tasks.ID_Clients (many)
T_Tasks.ID_Tasks is the primary key field of T_Tasks formatted as autonumber
(unlikely to be relevant to the remainder of this post).
The field "Ref" is formatted as text (in each table).
The values of T_Clients.Ref are unique in each record of T_Clients. Indeed
T_Clients.Ref could have been the primary key of T_Clients were it not for
the fact that ID_Clients is the primary key.
The main reason that I have a separate field ID_Clients designated as
primary key is because I want to grant the user the option to change the
value of T_Clients.Ref but I don't want them messing with the primary key.
Problem 1: If I use a form to amend the value of T_Clients.Ref in a record,
how do I prevent it from accepting a duplicate entry, ie if some other
record in T_Clients already contains the same value of Ref as that attempted
to be selected by the user?
There is in reality a one-to-one relationship between T_Clients.ID_Clients
and T_Clients.Ref, since both fields contain unique values within the table.
Problem 2: I have not been able to set up that one-to-one relationship
within Access. I opened the Relationships window, then opened two versions
of T_Clients table within it, so that it shows T_Clients and T_Clients_1. I
then tried to drag ID_Clients from T_Clients to Ref in T_Clients_1, enforce
referential integrity, and encountered two problems: One was that it
claimed that I was trying to create a one-to-many relationship (I have
tested T_Clients and confirmed that there are no duplicate entries of either
ID_Clients or Ref). The other is that it displayed error 3368, advising
that they must be formatted as the same data type. I cannot understand why
this is necessary, but given that it is necessary, I do not know how to
overcome it.
Any help with either of these would be appreciated.
Thanks
Access 97
I have two tables: T_Clients and T_Tasks.
They share fields ID_Clients and Ref
ID_Clients is the primary key in T_Clients, and is formatted as autonumber
in T_Clients
In T_Tasks, ID_Clients is formatted as a long integer.
There is a one to many relationship between T_Clients.ID_Clients (one) and
T_Tasks.ID_Clients (many)
T_Tasks.ID_Tasks is the primary key field of T_Tasks formatted as autonumber
(unlikely to be relevant to the remainder of this post).
The field "Ref" is formatted as text (in each table).
The values of T_Clients.Ref are unique in each record of T_Clients. Indeed
T_Clients.Ref could have been the primary key of T_Clients were it not for
the fact that ID_Clients is the primary key.
The main reason that I have a separate field ID_Clients designated as
primary key is because I want to grant the user the option to change the
value of T_Clients.Ref but I don't want them messing with the primary key.
Problem 1: If I use a form to amend the value of T_Clients.Ref in a record,
how do I prevent it from accepting a duplicate entry, ie if some other
record in T_Clients already contains the same value of Ref as that attempted
to be selected by the user?
There is in reality a one-to-one relationship between T_Clients.ID_Clients
and T_Clients.Ref, since both fields contain unique values within the table.
Problem 2: I have not been able to set up that one-to-one relationship
within Access. I opened the Relationships window, then opened two versions
of T_Clients table within it, so that it shows T_Clients and T_Clients_1. I
then tried to drag ID_Clients from T_Clients to Ref in T_Clients_1, enforce
referential integrity, and encountered two problems: One was that it
claimed that I was trying to create a one-to-many relationship (I have
tested T_Clients and confirmed that there are no duplicate entries of either
ID_Clients or Ref). The other is that it displayed error 3368, advising
that they must be formatted as the same data type. I cannot understand why
this is necessary, but given that it is necessary, I do not know how to
overcome it.
Any help with either of these would be appreciated.
Thanks