I'd endorse what Joseph has said insofar as not storing the 3PH prefix in the
table. As its value is constant its unnecessary, but more importantly it
leaves the table open to the risk of update anomalies as the prefix value
could be changed in one or more rows.
Where I'd differ however is that I'd be firmly of the opinion that the
prefix value should be stored in another single row table. It is data and in
a relational database data should be stored only as values at column
positions in rows in tables. This is Date's 'Information Principle' which he
states as:
'The entire information content of the database is represented in one and
only one way, namely as explicit values in column positions in rows in
tables'.
For the table's primary key column you can then have a simple incrementing
number column. When you want to see the full value including the prefix you
can do so in a query such as:
SELECT
Prefix & FORMAT(YourID,"0000") AS FullID,
Field1, Field2 …….
FROM YourTable, Prefixes
ORDER BY YourID;
Where Prefixes is the single row table with a column Prefix, and YourID is
the primary key column of YourTable. The query produces the 'Cartesian
product' of the two tables, i.e. each row in one is joined to each row in the
other.
The above query is not updateable so would not be suitable for the
RecordSource of a data input form. That could be based simply on YourTable
however and include a computed control with a ControlSource of:
=DLookup("Prefix","Prefixes") & Format(YourID,"0000")
Ken Sheridan
Stafford, England