Jump to content
Server Maintenance This Week. ×

Multipe match-field relationships


astral

This topic is 8699 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi..

I'm new to FM5, used MS Access in the past. I am trying to work out a multiple match-field realtionship, which is based on the following setup:

master file related file

ID ID

TYPE TYPE

etc... etc...

I want only records from the related file where both fields match! Any "easy" way to do this without having to use a join file, portal or self-join (some of the possible solutions I was told)?

I would also like to avoid scripts, since this makes "pushing" a button neccessary (FM5 has no event-handling besides startup and shutdown scripts as far as I have been told).

This kind of relationship is pretty simple, but seems (a least to me) difficult to implement in FM5, maybe due to the different approach to relationships in FM as opposed to Access or similar apps. Or is there a possiblity to define a relationship based on 2 (or more) fields?

thanx

Mike

Link to comment
Share on other sites

astral

you can create a calc field in each file (call it "link") which has ID & " " & TYPE as the calculation and returns a text result.

Then create a relationship from the master file to the related file based on these fields in each file.

You need to use a portal to view the related records in the master file... but portals aren't too hard to make... just draw it on the layout and put the fields you want in the first line of the portal (make sure none of the field borders are touching the lines and make sure you use the related fields (not the ones from the current file).

That's it. Email me if you want a demo to go through it in a bit more detail and to actually see it working.

quote:

Originally posted by astral:

Hi..

I'm new to FM5, used MS Access in the past. I am trying to work out a multiple match-field realtionship, which is based on the following setup:

master file related file

ID ID

TYPE TYPE

etc... etc...

I want only records from the related file where both fields match! Any "easy" way to do this without having to use a join file, portal or self-join (some of the possible solutions I was told)?

I would also like to avoid scripts, since this makes "pushing" a button neccessary (FM5 has no event-handling besides startup and shutdown scripts as far as I have been told).

This kind of relationship is pretty simple, but seems (a least to me) difficult to implement in FM5, maybe due to the different approach to relationships in FM as opposed to Access or similar apps. Or is there a possiblity to define a relationship based on 2 (or more) fields?

thanx

Mike

------------------

Andrew McCallum

McCALLUM CONSULTING P/L

Sydney, Australia

61 2 9585 8775

61 407 482 609

[email protected]

[This message has been edited by amccallum (edited July 11, 2000).]

Link to comment
Share on other sites

  • Newbies

Hi Andrew

Thank you for your quick help! Your solution is so simple I just didn't think of it!

There is only one small problem:

It's not the most elegant way of doing it, coz you have to include one new field in both files just for the calculation and the portal in the masterfile is based on the calc field relationship.

(How about a logical OR relationship?)

But it works now. Thanks again!

Mike

Link to comment
Share on other sites

hi

Glad it worked for you..

There is no 'OR' relationship as such (however there are ways to simulate one)... wouldn't you be after an 'AND' relationship anyway (ie ID AND Type)?.. there isn't one of these either.

There is no need to display the calculated link field anywhere... it just needs to exist in the background... and the calc field can be indexed so there are no problems getting the relationship to work... and work quickly at that. It is just like introducing another secondary key to your file.

quote:

Originally posted by astral:

Hi Andrew

Thank you for your quick help! Your solution is so simple I just didn't think of it!

There is only one small problem:

It's not the most elegant way of doing it, coz you have to include one new field in both files just for the calculation and the portal in the masterfile is based on the calc field relationship.

(How about a logical OR relationship?)

But it works now. Thanks again!

Mike

------------------

Andrew McCallum

McCALLUM CONSULTING P/L

Sydney, Australia

61 2 9585 8775

61 407 482 609

[email protected]

Link to comment
Share on other sites

This topic is 8699 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.