First I suggest you consider the evils of lookup fields. I think they really obscure the structure and this lead to design errors. I'd get rid of them. One thing that seems to be wrong with your structure is the lack of a single table that defines what the autotext should be. If I understand your requirement these are defined by the recipient type, the product, and the language. There should be a table with these three attributes and the autotext. Please open the attached database and look at the tblLetterAutoText in design view. I set this table up that way. Note that the product is short text. I see no point in trying to assign an autonumber to this anywhere as that's not how it is in the tblBene table. The language is a number data type which matches the option group on the form.
If you look at the FilterList code in the sfLetter form module you will see that there is only one initial strRS and the language has been moved to the WHERE clause where is should be. Also the DLookup has been removed from the loop that forms the comma separated list. Instead of ids the list is made up of the left part of the product name.
So I suggest restructuring your data something like this. If not this then at least in normal form and without the lookup fields in the tables. If you have a lot of data that needs to be convert to the new structure let me know and I'll help you with the queries you will need to do this.
Thanks for your help! I get more where I should go with this.
That really gives me a clear way of dealing with the structure of it.
Very appreciated! I just started the project, so there is no data to move. I will work base on your sample and modified it to adapt to my requirement.
Thanks everyone else that were willing to help too
