` Printed Icetips Article

Icetips Article



Par2: Locator for secondary file in a browse
2001-06-08 -- Dennis Evans
 
>On the second tab the browse is sorted by a
> field in the secondary file (which is the one part of the one to 
>many relationship).  Because of this there is no key in the second 
>tab. However my users want to be able to have an entry locator 
>in the secondary table  to more easily find records.

   If you are using the Additional Sort fields to set the sort order of the
second browse, then the ResetFromBuffer and the Reset methods will
accomplish the task.

  Add a control to the screen, call it tempValue or something

  in the accepted event for the control

  Pre:FileField = tempValue
  BrwX.ResetFromBuffer()

  now in the Reset(byte Locate) method for the browse, before the parent
call

  if (tempValue)     ! something is there
     Locate = X
  end

  X will be equal to the sequence position of the field you want to locate.
Example, if the sort order is
Pre:FieldOne, Pre:FieldTwo and you want to locate FieldTwo then X would be
2, or three and so on.
Since you are not using a File relationship, no key, to limit the browse you
will need to make sure the fields prior to the one you want to locate are
primed correctly.

If the child browse is range limited by the parent and using additional sort
fields then all that you need to do is add locator normally and adjust the
value returned by the GetFreeElementPosition and the locators free element
property.



Printed May 8, 2024, 4:48 pm
This article has been viewed/printed 35120 times.