How can I add sub-datasheets dynamically in code to an Access form?

I have an account string that could use anywhere from 2 to 9 segments. I want to be able to drill down on each segment, eventually to the very bottom level. However, for the same application, any given database may have anywhere from 2 to 9 segments. So, if one database has 4 segments, I would want to generate a
- with a sub-datasheet,
--with a sub-datasheet,
---with a final sub-datasheet at the 4th level.

However, if someone else has 6 segments, I will want to generate sub-datasheets dynamically for them down to 6 levels, and so on.