Easy to Create, Easy to Change - Easy to use!


going to related record from one form to another


Started by Gregor Popp
Search
You will need to Sign In to be able to add or comment on the forum!

going to related record from one form to another

I am trying to create a button that takes me from Form1 to a related record in Form2, I have tried the FormOpenRelated(Form2) function.

But this does not exactly do what I want. This does take me to the related record in the form.

I would then like to also be able to look at other records in that form (Form2).

and then go from Form2 back to related record in Form1 which might be different to the original record.

In short I want to go back and forth between two forms and whichever record I am viewing I go to the related record in the other form.

I hope this makes sense, any suggestions?

Written by Gregor Popp 26/08/13 at 06:40:51 Dataease [{8}]FIVE

Re:going to related record from one form to another

It makes sense, but it is not how searching works in DFW.

In DFD you search up the first matching record in a query and you could then go Next, Previous from there or go to the next matching record.

In DFW it is designed to return a cursor for the query, so if you search for CustomerName="A*" it will return a cursor for all the records that have a customername that start with "A". If the field is index, the cursor will return them in alphabetical order, and if the fields is not indexed, in creation order.

However, this doesn't help you a lot....

To Do what you want, you have to create the functionality yourself.

The solution is different depending if you want, but the solution is to use SetVar()/GetVar() to do the selection criteria for the "related" for, and change the Selection criteria manually.

You Set the Global variable on the "Open Related" button in the first form,
ex .SetVar("MyCustomerNr",Customernr)+DocumentOpen("MyNewForm")

and then use the criteria in the QBM selection criteria for the form.

CustomerNr=GetVar("MyCustomerNr")

You can then manipulate the global variable and re-open the document with the changed criteria.

When you return to form1 you do the same in reverse.

We will try to make a sample and upload if this was a little "cryptical".


Written by DataEase Tech Sup 26/08/13 at 12:00:19 Dataease [{8}]FIVE

Re:Re:going to related record from one form to another

A sample would be great, this is not about sorting but comparing results when we change data in form1 to the form2

Written by Gregor Popp 26/08/13 at 20:05:38 Dataease [{8}]FIVE

Re:Re:Re:going to related record from one form to another

Ion.
If you send us a small app which illustrate what you want to do, we will amend it to solve the problem.

As it stands now, I don't think we really get what you are trying to do ;-)


Send it to techsup@dataease.com

Written by DataEase Tech Sup 28/08/13 at 12:34:43 Dataease [{8}]FIVE