In an Access table, I can easily designate a field as
unique so that 2 records can not have the same data in
that field. How can I specify that records be unique
based upon 2 fields?
Use the Indexes window: in the table design window, click the little button
that looks like a lightning strike (or choose View | Indexes).
In the grid, find an empty row and put a name (any name: for example
idxNameAndAge or whatever) in the first column. Now set the properties in
the lower pane: Primary (no), Unique (yes), Ignore Nulls (whatever). Now go
back to the upper pane in the second column, starting in the same row, pick
the first field to be indexed, then below that choose the next field and so
on. This is what mine looks like:
OtherKey OName Ascending
Age Ascending
PrimaryKey IndexID Ascending
which defines two indexes. Not intuitive to begin with, but easy enough to
use once you get used to it.
Don't forget that if you are indexing a table with data in it, they must be
unique before you start... Otherwise it won't error out until right at the
end.
Hope that helps
Tim F