M
Marshall Smith
OK, I have a problem that would have a very easy, elegant solution IF I had
one missing piece.
I have a Contacts table and a ContactCategories table. Each Contact can
have multiple Categories. Now, I want to create a form that will display
each Contact. In addition to some other filter criteria, I would like it
for the user to be able to show only Contacts belonging to a given Category.
If I simply include the ContactCategories in the form recordsource, it gives
me a copy of each Contact for each ContactCategory. This is not desirable.
If I do not include it, and put the ContactCategories in a separate pop-up
form, then filtering the records by Category is a tricky, laborious process.
I can do it, but I don't want to.
Now, the elegant solution is to create an aggregate function that would
simply concatenate all of the Category names in the recordsource query,
grouped by Contact. One record per contact, but it can be filtered by using
LIKE on the concatenated string. However, there is no concatenation
aggregate function that I can find.
Does anyone know how I could go about creating a new aggregate function?
Or, a different solution for this problem?
one missing piece.
I have a Contacts table and a ContactCategories table. Each Contact can
have multiple Categories. Now, I want to create a form that will display
each Contact. In addition to some other filter criteria, I would like it
for the user to be able to show only Contacts belonging to a given Category.
If I simply include the ContactCategories in the form recordsource, it gives
me a copy of each Contact for each ContactCategory. This is not desirable.
If I do not include it, and put the ContactCategories in a separate pop-up
form, then filtering the records by Category is a tricky, laborious process.
I can do it, but I don't want to.
Now, the elegant solution is to create an aggregate function that would
simply concatenate all of the Category names in the recordsource query,
grouped by Contact. One record per contact, but it can be filtered by using
LIKE on the concatenated string. However, there is no concatenation
aggregate function that I can find.
Does anyone know how I could go about creating a new aggregate function?
Or, a different solution for this problem?