Anyone know how from a Subform I can get current information from the Parent form? I have a Form that goes through the Customer table. This Form has linked subform connected to a different table (Foo) that includes the Customer No. When I add a record to the Foo table using the Subform, I’d like the Subform to know which Customer record the main Form is currently displaying so I can pre-populate the Foo record with the proper Customer No. Appreciate any help. -Alan K.
If the Customer No. is part of the Foo tables primary key then it will be updated automatic. If not then it must be a filtered field. Example if you have a field that is not part of the primary key, but is filtered. A good example is the Menu option on the Customer Card > Sales > Orders, the Sales Header primary key is “Document Type” & “No.”, the menu item is linked on “Sell-to Customer No.” = “No.”, when you Insert a new record the “Sell-to Customer No.” is poulated and Validated. How ? If you look at the OnInsert trigger of the Sales Header table you will see the code. Something like: IF GETFILTER(“Sell-to Customer No.”) <> ‘’ THEN IF GETRANGEMIN(“Sell-to Customer No.”)=GETRANGEMAX(“Sell-to Customer No.”)THEN VALIDATE(“Sell-to Customer No.”,GETRANGEMIN(“Customer No.”)); Have Fun!
Thanks David. The GetRangeMin & Max methods work as you say. Problem solved! I appreciate your help.