Function preorderProcessing(parentID As Integer)
Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset
Dim x As Integer
Set MyDB = CurrentDb()
Dim qdf As DAO.QueryDef
Set colOrgUnits = New Collection
If parentID = 0 Then
Set qdf = MyDB.QueryDefs("qyrOrgUnits_SearchParentID_Null")
Else
Set qdf = MyDB.QueryDefs("qryOrgUnits_SearchParentID")
qdf.Parameters("parentID") = parentID
End If
Dim rs As DAO.Recordset
Set rs = qdf.OpenRecordset
Do While Not rs.EOF
colOrgUnits.Add (rs.Fields("org_OrganisationUnitID"))
rs.MoveNext
Loop
rs.Close
'debug
Debug.Print "Now checking units: "
For x = 1 To colOrgUnits.Count
Debug.Print "In this stack: " & colOrgUnits.Item(x)
Next x
Debug.Print "COUNT: " & colOrgUnits.Count
If colOrgUnits.Count > 0 Then
For x = 1 To colOrgUnits.Count
Debug.Print "Organisational Unit: " & colOrgUnits.Item(x)
preorderProcessing (colOrgUnits.Item(x))
Next x
End If
End Function
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”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.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.