I am trying to open a new form in the same set, while maintaining the current record and order. Essentially, a toggle between forms but with different window dimensions.
I have tried various methods, but the simplest seems to be to define a global variable N with TBL. logicalrecord_get() on the first form, open the second form, and set the current record with TBL.logicalrecord_set(N).
This method works if I put the TBL.logicalrecord_Set() on the OnActivate event of the second form, but I'm trying to create a global script that I can attach to a toolbar.
What happens now is that the TBL.logicalrecord_set() is operating on the first form, not the second. If I close the first form before opening the second, it still doesn't work. The TBL pointer seems to stay with the primary table in the first form.
I guess my question is how do I get a pointer to the primary table in the second form so that the TBL.logicalrecord_set() works.
Or, if there's a better way to toggle to another form, please tell me how.
Below is my current script, which is 3 Action Script steps converted to Xbasic:
Thanks
I have tried various methods, but the simplest seems to be to define a global variable N with TBL. logicalrecord_get() on the first form, open the second form, and set the current record with TBL.logicalrecord_set(N).
This method works if I put the TBL.logicalrecord_Set() on the OnActivate event of the second form, but I'm trying to create a global script that I can attach to a toolbar.
What happens now is that the TBL.logicalrecord_set() is operating on the first form, not the second. If I close the first form before opening the second, it still doesn't work. The TBL pointer seems to stay with the primary table in the first form.
I guess my question is how do I get a pointer to the primary table in the second form so that the TBL.logicalrecord_set() works.
Or, if there's a better way to toggle to another form, please tell me how.
Below is my current script, which is 3 Action Script steps converted to Xbasic:
Code:
[B][U]Step 1[/U][/B] 'Execute inline Xbasic code. dim tbl as P dim global n as n tbl = table.current() n = tbl.LogicalRecord_Get() form.Close() [B][U]Step 2[/U][/B] 'Open a Form or Browse layout, displaying all, or selected records in the layout. DIM Shared varP_PullBrowse as P DIM layout_name as c layout_name = "PullBrowse" DIM tempP as p 'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it tempP=obj(":"+object_Name_normalize(word(layout_name,1,"@"))) 'Test if pointer is valid if is_object(tempP) then 'Test if pointer refers to a form or browse if tempP.class() = "form" .or. tempP.class() = "browse" then 'If so, then activate the already open window tempP.activate() else 'Window is not already open, so open it varP_PullBrowse = :Form.view(layout_name) end if else varP_PullBrowse = :Form.view(layout_name) end if [B][U]Step 3[/U][/B] 'Execute inline Xbasic code. tbl.logicalrecord_set(n) parentform.Resynch()
Comment