The Access database is attached for your review and comments.
My Child is E2E_ID. Every child has a parent with the exception of the top children.
My Parent is Parent_ID
My Sort is Sort
Ideally the Parent_ID with the blank value and a sort value of 1 is the first item on the query and...
I guess we work our way through this more deliberately.....
This code is erroring on Parent_ID = rs!Parent_ID because the former value is null??
Public Function getTopParent(varid As Variant) As Long
Dim rs As DAO.Recordset
Dim Parent_ID As Variant
Dim strSql As String
strSql =...
Brought in the code to my test database. Erroring in the getParent code, so needed to comment it out.
Can you take a look at the attachment and comment where I don't have it right.https://files.engineering.com/getfile.aspx?folder=056dd957-1973-4ed1-bc26-b344b5b4ff46&file=Hierarchy.accdb
How would I modify this code to get me the Parent one level up from the current record?
https://www.tek-tips.com/viewthread.cfm?qid=1516577
Public Function getTopParent(varID As Variant) As Long
Dim rs As DAO.Recordset
Dim parentID As Variant
Dim strSql As String
strSql = "Select...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.