P
PayeDoc
Hello All
I have a table that already has an autonumber key field called [empID],
which must be retained. For reason I won't bore anyone with, I now need to
add another field [newID] the values for which which must be editable, but
such that the value of [newID] must be unique for each value of the text
field [clientname]. The problem is that [newID] will initially have to be
empty for each new record, as its value will only be know some time after
the record is added, this means that duplications of [newID] for a given
value of [clientname] will have to be allowed where [newID] is empty.
So:
[empID] = 1, [newID] = 1, [clientname] = "abc"
[empID] = 2, [newID] = 2, [clientname] = "abc"
[empID] = 3, [newID] = 3, [clientname] = "abc"
[empID] = 4, [newID] = 1, [clientname] = "def"
[empID] = 5, [newID] = 2, [clientname] = "def"
[empID] = 6, [newID] = 3, [clientname] = "def"
[empID] = 7, [newID] = null/empty, [clientname] = "abc"
[empID] = 8, [newID] = null/empty, [clientname] = "abc"
[empID] = 9, [newID] = null/empty [clientname] = "abc"
.... are all OK, but
[empID] = 1, [newID] = 1, [clientname] = "abc"
[empID] = 2, [newID] = 1, [clientname] = "abc"
must be prevented.
I can't see how to do this, and have looked in Help but not got very far!
Hope someone can help.
Many thanks
Leslie Isaacs
I have a table that already has an autonumber key field called [empID],
which must be retained. For reason I won't bore anyone with, I now need to
add another field [newID] the values for which which must be editable, but
such that the value of [newID] must be unique for each value of the text
field [clientname]. The problem is that [newID] will initially have to be
empty for each new record, as its value will only be know some time after
the record is added, this means that duplications of [newID] for a given
value of [clientname] will have to be allowed where [newID] is empty.
So:
[empID] = 1, [newID] = 1, [clientname] = "abc"
[empID] = 2, [newID] = 2, [clientname] = "abc"
[empID] = 3, [newID] = 3, [clientname] = "abc"
[empID] = 4, [newID] = 1, [clientname] = "def"
[empID] = 5, [newID] = 2, [clientname] = "def"
[empID] = 6, [newID] = 3, [clientname] = "def"
[empID] = 7, [newID] = null/empty, [clientname] = "abc"
[empID] = 8, [newID] = null/empty, [clientname] = "abc"
[empID] = 9, [newID] = null/empty [clientname] = "abc"
.... are all OK, but
[empID] = 1, [newID] = 1, [clientname] = "abc"
[empID] = 2, [newID] = 1, [clientname] = "abc"
must be prevented.
I can't see how to do this, and have looked in Help but not got very far!
Hope someone can help.
Many thanks
Leslie Isaacs