Hi Chris

Quote Originally Posted by Chrisk14 View Post
Set pbUseDDRelates to True
Set Field_Related_FileField Field Child.Tenant_Id to File_Field Parent2.Tenant_Id // Re-used tenant_Id field ?!?
Set Field_Related_FileField Field Child.Parent2_Id to File_Field Parent2.Parent2_Id
I've been running Multi-Tenant, single database applications on DF using hard relationships in both Windows and WebApps for over 20 years without problems.

It appears from the above that you are attempting to give a User access to multiple Tenants in the same session. if so, that's a big NO NO! The "secret" is to use the Login mechanism to limit each User's session to a single Tenant. Once you do that, there are no problems with hard or soft relationships since every table which needs to relate to the Tenant table will always be using the same record.

If there are some users who require access to more than one Tenant (Administrators for a group of Tenants, say) then during Login you should build them a restricted list of Tenants that they can access so they can choose the particular Tenant on which to operate. Thereafter, the Session is restricted to that Tenant. If, during that session such a user wants to operate on another of their allowed Tenants, then they should choose one from a Combo Form (say) and thereafter they will be restricted to that Tenant until they Logout or select a different Tenant.

If a user needs access to common Tables (Inventory, say) then those Tables should have no relationship to the Tenant Table. In an SQL world such tables might be in a different Database.

Ian