I have a main form (card form) and a subform(list form) and in the code behind the main form I am trying to find out which record in the subform has been selected.
Say for instance I need to get the primary key of the record selected on the subform when the user clicks a button on the main form and then use this to do some further processing
I have tried using the currform.subformcontrol.FORM to get a handle on the sub form but this does not seem to work. There must be a simple way to to do this but I can't see it. Advice would be appriciated.
0
Comments
On the subform, create a function that acccepts as a parameter whatever value you need and returns that value:
EXIT(some_parameter_value);
Call this function on the OnAfterGetCurrRecord trigger of the subform.
Now, on the main form, when you want to know which record is selected just call that function:
some_variable := CurrForm.Subform.FORM.subform_function;
You may also be able to accomplish the same thing with a GETRECORD.
Yes you can
Specify a name for your subform and a variable that matches the records in the subform (ie. SalesLines) then the code will be somethnig like this:
Then your code would use the information from myrecord.
I am spolied for choice!