Access to a variable from a subform

Guga84Guga84 Member Posts: 24
Hi, I’m modifying the Purchase Quote form. I have added a new tab (subform) that is linked with the Purchase Quote table with the “No.”, I’ve done that with the subFormLink property, no problem.

Now, I need to filter this tab with the current Purchase Quote “No.” to use in some functions inside the subform, but I don’t know how to do it.
I don´t know how the subform can access to the current Purchase Quote “No.”.

So the problem could be sump up in access the current variable from a subform.
Any idea?

I’m thinking in mark options or use a “global variable” in a temporally table, but I hope there are better solutions.

Thanks.

Answers

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    If the source table from the subform has the linked field in the clustered index the value is auto-populated.

    If that does not work you can create a function in the subform to pass the number.

    Give the Subform a name in the properties and you can access the function.
  • Guga84Guga84 Member Posts: 24
    If the source table from the subform has the linked field in the clustered index the value is auto-populated.

    I don't understand that sentense, so I choose the second solution and it works.

    Thanks.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Sorry, I am talking SQL.

    Every table has a primairy key. When one of these fields is in the linked view that value will be automaticaly filled when a new record is created.
  • DenSterDenSter Member Posts: 8,305
    Take a look at the lines subform for an example. Open the quote form in the form designer, select the lines subform and open the properties page. What you are looking for is the SubFormLink property.
Sign In or Register to comment.