Call your Type TAdminDepartment and your field AdminDepartment that way BlitzMax knows exactly what you are referring to.
At the moment I think the compiler suspects you are actually wanting:
self.AdminDepartment=Self.AdminDepartment.CreateAdminDepartment()
which is causing a null pointer because the right hand side is using the null Self.AdminDepartment field not the TAdminDepartment type to locate the CreateAdmin function.
At the moment I think the compiler suspects you are actually wanting:
self.AdminDepartment=Self.AdminDepartment.CreateAdminDepartment()
which is causing a null pointer because the right hand side is using the null Self.AdminDepartment field not the TAdminDepartment type to locate the CreateAdmin function.