P
Peter
I can't believe I'm the only person with this problem, but the
archives don't seem to have much devoted to the subject. Maybe I'm
just doing a bad job of searching.
I have a main table of specimens with many linked tables of such things
as genus, species, locality, country, discoverer and so on. They are
joined in 1-M relationships, and the auxiliary tables serve largely to
populate comboboxes on the main data entry from. I need to create
pre-defined sorts and filters for various uses. The filters were fairly
simple, even when filtering by criteria not in the main table, by using
clauses like
"IDCislo IN (SELECT Matrix.IDCislo FROM Matrix)"
or
"IDCislo IN (SELECT IDCislo FROM FilterLokalita)"
to select only those records in the main form whose corresponding
record in a linked table has some specific value or property. However,
I can't seem to do anything comparable for sorting. That is, I want
to sort the records in the main from by a field OTHER THAN the primary
key of a linked table, which I don't have directly available, the
same way I filter by values that I don't have directly available.
I found one post from Allen Browne, back in 2004, that advised someone
to set up a query that includes those fields, with certain conditions
applied (no default values). I tried that, but the linked tables have
required fields, which causes addition of records to bomb. When I make
the fields not required, adding a main record also adds a record with
empty field to the linked table.
Is this a lost cause or am I just being stupid (again)?
Pete
archives don't seem to have much devoted to the subject. Maybe I'm
just doing a bad job of searching.
I have a main table of specimens with many linked tables of such things
as genus, species, locality, country, discoverer and so on. They are
joined in 1-M relationships, and the auxiliary tables serve largely to
populate comboboxes on the main data entry from. I need to create
pre-defined sorts and filters for various uses. The filters were fairly
simple, even when filtering by criteria not in the main table, by using
clauses like
"IDCislo IN (SELECT Matrix.IDCislo FROM Matrix)"
or
"IDCislo IN (SELECT IDCislo FROM FilterLokalita)"
to select only those records in the main form whose corresponding
record in a linked table has some specific value or property. However,
I can't seem to do anything comparable for sorting. That is, I want
to sort the records in the main from by a field OTHER THAN the primary
key of a linked table, which I don't have directly available, the
same way I filter by values that I don't have directly available.
I found one post from Allen Browne, back in 2004, that advised someone
to set up a query that includes those fields, with certain conditions
applied (no default values). I tried that, but the linked tables have
required fields, which causes addition of records to bomb. When I make
the fields not required, adding a main record also adds a record with
empty field to the linked table.
Is this a lost cause or am I just being stupid (again)?
Pete