Hi
I would like to make a text document database as follows.
Store the paragraphs in tblPara with fields idPara and txtPara.
The id is of course the key which is an int. The txtPara is a string.
I would then like to store the desired paragraphs by number in tblDoc with fields idDoc and docContent.
id is again an integer key; docContent is a string.
For example
idDoc = 1; docContent = 1,2,9,12,20 or it could be (1,2,9,12,20) .
The next document could be 5,6,9,12,19,20 etc this would be iddoc=2 etc.
I then wish to assemble the document in a query + subquery something like the following:
Code:
SELECT tblPara.Para, tblPara.idPara
FROM tblDoc, tblPara
WHERE ([tblPara].[idPara] IN
(SELECT [tblDoc].[DocContent] FROM [tblDoc] WHERE [tblDoc].[idDoc]=1));
However I try and do this Access returns errors,
I have tried casts as Cint or Cstr but nothing works.
Is it possible to recover the value list for the IN() expression from a database?
Can you suggest how to make the code work please?
Thanks
Scriptham