troubleshooting Question

How do i fill a 2 Diminisional Array wit data from MS Acess Table

Avatar of juricta
jurictaFlag for United States of America asked on
* arraysMicrosoft Access
10 Comments1 Solution62 ViewsLast Modified:
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!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros