Help with code

R

ron.pennenga

I need to have a field(textbox) which will tabulate and display the
total of all the nonnull fields in a record.

Here is my setup: I have one table consisting of (for example) 5
records (Bob, Mike, Tom, Joe, and Matt). Each persons has to perform 5
tasks to be complete (having a date in the Task X field signifies
completion of that specific task).
However, I need to track the total amount progress for each individual
by counting the number of nonnull fields in each record (Tasks that
have dates in them), and then store that number within the respective
record and display this number a form.

I have a table which contains the following:


Name Task 1 Task 2 Task 3 Task
4 Task 5 Total

Bob 1/1/09 1/10/09 12/15/08
12/30/08 4
Mike 1/5/09 1/12/09
11/15/08 3
Tom 11/1/08 1/3/09 12/05/08
11/30/08 4
Joe 1/1/09 1/10/09 12/15/08
12/30/08 4
Matt
11/30/08
12/10/08 2




Is there a way to perform this, possibly using a VBA function. I am
completely illiterate in SQL and am useless when it comes to queries.

Thanks in advance for the help!
 
M

Mike Painter

If you have fields named Task 1, Task 2, ... in the same table you should
rethink your design
You should have a table for people and one for tasks.
The task table would have fields for the person, the task, and the date.
Done this way, it is a simple matter to show what you want with essentially
no coding and you can add tasks or track start dates if needed.
It is possible to do what you want but it will require a lot of coding and
be difficult to maintain.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top