SubFormLink using variable

Hi, I have a problem - I want to use a variable entered on a Main Form to determine what is displayed on a sub form. I don’t appear to be able to enter variables into the SubFormLink property. Is there some way of doing this? I have been able to send the variable to the subform and display it - but don’t know how to use it to filter the records that are displayed.

Hi Veronica, create a function in the Subform, where you pass via parameters the values you want to filter the subform. And in this function you set the filter with setrange and setfilter. After setting the filter use an Currform.update(false) In the Mainform, for example in the OnAfterValidate-Trigger of the textbox, you use: currform..form.(<paramaters<); This should do the work. Greetings , Frank

One addition to Frank’s suggestion would be to use filter group 4 when setting your filters on the subform.

Hi Frank, Many thanks - I have just tried your the code you suggeted and it works perfectly. Regards, Veronica [:)]