I have 2xTable (Main and Task). Main has 1000 records with a FIELD named TaskXAssigned (the X is based on a Task number). Task has multiple tasks (Fields=ID and Task)
I want to create a DOUBLE FOR loop that will COUNT the number of EACH task assigned (TaskXAssigned). The OUTSIDE FOR loop counts the number of TASKs in the Task table and the INSIDE FOR loop uses the number of records in the Main table.
EXAMPLE:
I=Dcount(Task table) =25 Tasks...........there are a total of 25 Tasks
Z=Dcount(Maintable)=1000 records.need to find out how many of these have data in TaskXAssigned *where X=1-Dcount)
FOR vTask=1 TO Dcount (Whatever I equals- # Tasks)
FOR vRecord=1 TO Dcount (Whatever Z equals - # Reords)
HELP!!! 'NEED to create a variable for Counter based on Task number (like ctr1 for Task1, ctr2 for Task2, etc)
vTaskAssigned = "Task" & I & "Assigned" 'This will become Tasl1Assigned, Task2Assigned, etc
(If IsNull(DLookup(vTaskAssigned, "Main")) Then 'Nothing happens
ELSE:
CREATED counter is incremented by 1
STORE variable and counter in ARRAY
ENDIF
NEXT vRecord
NEXT vTask
What I hope to have at the end is something SHOWING me :
Task1=Counter1 and # of records with Task1Assigned
Task2=Counter1 and # of records with Task2Assigned
Task3=Counter1 and # of records with Task3Assigned etc
A report will be generated :
Task Number # of Records
1 200
2 124
3 5
Please help!