I would say this is one large "IF" statement. You to test each feild representing a month to find one value.
I am not sure about the requirements of your database, but I have three concerns about your database...
- Fields names JanTotal, FebTotal ... suggests that you are "hard coding" your months
- Field names Nov02Total, Dec02Total suggests that you may be hard coding your years.
- Field names Nov02Total, Dec02Total suggest that you are storing totals.
Please review the following fundementals on relational databases...
Fundamentals of Relational Database Design by Paul Litwin
Download document
Read on-line (HTML)
Micro$oft's answer...
283878 - Description of the database normalization basics
304467 - ACC2000 Defining Relationships Between Tables in a Microsoft Access Database
Now some times, it may be necessary to store totals, but normalization suggests that it is better to calculate then when requried. I wrote a post on this topic last year...
Add data to a table from an equation, how?
Take advantage of date fields.
If you feel you have to storing the transaction month, treat the month as a field instead of storing numbers for each month.
Unless there are good reasons, calculate totals when your require them.
To use a non-normalized database can result in...
- difficulty in extracting information
- very long SELECT statements and fields that may tax the limits of Access
- a heck of a lot of maintenance. For example, having to add new fields for each year whihc would then require changes to the forms, reports and queries.
If you choose to continue with your current design, I can understand -- you have a lot of time invested in the current databse, but you may be heading to a lot of frustrating times where you have to figure out work-around solutions to "force" the information out of your database.
Good luck.
Richard