From: Pamela on
I have created a db w/ a form to allow the user to input in fields and select
through combo boxes & list boxes certain info pertaining to a physical job
they just completed. My goal is to use this data to lookup and concatenate
fairly large amounts of text into a single paragraph onto the form which the
user can then copy & paste into our clients' system. Would it be easiest to
accomplish this by writing the long and complicated If statements into the
code or use tables for each criteria? Or perhaps another solution? I
currently have it in excel but it is very limited in input and access allows
many more options.

Thanks so much!

Pamela
From: Clifford Bass on
Hi Pamela,

Put the paragraph parts into one or more tables and make your code
generic so that as the needs change, the use can add, update and delete the
paragraph parts in the tables, without any changes needed to your code. As a
computer science professor of my used to say: "Don't put data in your code.".
Your code should be independent of the data and work with any data the user
supplies. You might have a structure something like this:

tblParagraphParts
PartID
Description
TheText

On you form, say in a combo box, it could list the PartID (maybe
hidden) and the description. When generating the paragraph you would use
something like this to get the text for the selected part:

strText = DLookup("TheText", "tblParagraphParts", "PartID = " & [cbPartID])

Hope that helps,

Clifford Bass

"Pamela" wrote:

> I have created a db w/ a form to allow the user to input in fields and select
> through combo boxes & list boxes certain info pertaining to a physical job
> they just completed. My goal is to use this data to lookup and concatenate
> fairly large amounts of text into a single paragraph onto the form which the
> user can then copy & paste into our clients' system. Would it be easiest to
> accomplish this by writing the long and complicated If statements into the
> code or use tables for each criteria? Or perhaps another solution? I
> currently have it in excel but it is very limited in input and access allows
> many more options.
>
> Thanks so much!
>
> Pamela