Hi Pokdbz,
Your task would be incredibly easy if the database design was correct.
Having multiple fields that store similar data is not considered correct
database design. You are actually storing a one-to-many (or many-to-many)
relationship within a single table by doing so.
The best investment of your time, in my opinion, is to rework the design of
your database. While you can use VBA code to add up the values in the various
fields, you are working A LOT harder than you need to with such a design.
However, if you want to try with your current design, you can try using a
series of IIF statements or a custom VBA function. Here's an example to get
you started with IIF statements, which you would do in query design view:
Field: MyTotal: IIF(Nz([mmse_01]<=1,[mmse_01],0)) +
IIF(Nz([mmse_02]<=1,[mmse_02],0)).........IIF(Nz([mmse_26]<=1,[mmse_26],0))
You can press Shift F2 to open a window to help you enter this huge string.
Here are some resources to database design papers:
http://www.datatexcg.com/Downloads/DatabaseDesignTips1997.pdf
http://www.datadynamicsnw.com/accesssig/downloads.htm
(See the last download titled "Understanding Normalization")
http://support.microsoft.com/?id=234208
http://support.microsoft.com/?id=289533
Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
:
I have 26 fields mmse_01...mmse_26. I need to add up each of the fields if
the answer is <= 1 for each one. What is the best way to go about doing
this. An example would be helpful.