R.bianco's solution is correct. Is this way you can separate the forms by creating two procedures, it has to be noticed that the one in the Detail form doesn't contain references to the Licences one. This is a good thing.
But there is also another method that has to be listed. Let me start with an example.
If you have to implement this kind of behavior with two related tables, such as Products and Categories, you can use a lookup form instead of a normal one in order to show the Categories (or you can just convert a normal form into lookup by using the
Make Lookup command of its contextual menu). Then you have to:
- Drag & drop the Categories lookup form onto the CategoryID field (or onto the possibile CategoryName lookup field in the Products panel)
- Set the Categories panel's Initial Status property to "Set lookup values and find".
In this way, when you click on che
CategoryID field the lookup form will open, already showing only the right category. Internally the framework senses that the user want to look for a category (because it was activated by a
CategoryID field) and that the Products table is related to the Categories one with a foreign key. So, right after loading the form, it adds the proper where clause condition to the Categories Panel's master query and then launch the
FindData panel command.
You can extend this example in your case too, just use a properly configurated lookup form to show the licence's details and set it as the activation object of the
Lic_ID field.
Plus, if you don't want to have a visibile
Lic_ID field in your panel you can also create a
"View details" button and d&d the lookup form on it too. If the lookup form is the activation object of both the
Lic_ID invisibile panel field and the
View details button, the trick will work anyway.