J
Jim
I have tblAccounts, where I have the following (each field will be
sorted on):
field1 long integer
field2 long integer
field3 text (this field can be null-see below)
Field1 & "-" & Field2 & Field3 = Field4 (text), which is the primary
key.
thus,
10 & "-" 200 & AH = Account# 10-200AH
The primary key (10-200AH) is the foreign key in several other tables.
My question is, would it be better to have field1,field2,field3 a
"multiple field primary key", which would mean that I would need to
require a zero in field3 if null and just display "" (blank) for
field3 in any reports. Thats why I didn't make the 3 fields a primary
key to begin with, because of nulls in field3.
But, I'm revisting my design for two reasons. First, in making any
queries, I have to be sure to add the "breakdown" of the account
number in order to sort correctly. Second, I have a Form where user
enters field1, field2, field3, and the afterupdate event of each is:
Field4 = Field1 & "-" & Field2 & Field3
But, I've run across a couple of instances where user somehow mananged
to not fill in complete account or whatever strange thing happened,
and the PK field (field4) didn't get updated properly.
Any suggestions would be appreciated
Thanks, Jim
sorted on):
field1 long integer
field2 long integer
field3 text (this field can be null-see below)
Field1 & "-" & Field2 & Field3 = Field4 (text), which is the primary
key.
thus,
10 & "-" 200 & AH = Account# 10-200AH
The primary key (10-200AH) is the foreign key in several other tables.
My question is, would it be better to have field1,field2,field3 a
"multiple field primary key", which would mean that I would need to
require a zero in field3 if null and just display "" (blank) for
field3 in any reports. Thats why I didn't make the 3 fields a primary
key to begin with, because of nulls in field3.
But, I'm revisting my design for two reasons. First, in making any
queries, I have to be sure to add the "breakdown" of the account
number in order to sort correctly. Second, I have a Form where user
enters field1, field2, field3, and the afterupdate event of each is:
Field4 = Field1 & "-" & Field2 & Field3
But, I've run across a couple of instances where user somehow mananged
to not fill in complete account or whatever strange thing happened,
and the PK field (field4) didn't get updated properly.
Any suggestions would be appreciated
Thanks, Jim