Jump to content

Shouldnt be so hard... i must be missing somehting.


burnerofhells

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

Recommended Posts

Heres the problem, i am pretty sure i am doing everything correct but i cant get this to work.

There are two layouts.

There are two tables.

Layout 1 - uses table 1

Layout 2 - uses table 2

I want to display a value on layout 2 from table 1. A relationship is required because layout 2 is associated with table2 not table 1.

Primary key from table 1 is set to auto serial. I have a 1 to many relationship from table 1 primary key going to the foreign key of table 2.

This should allow me to display values from table 1 on layout 2 which is associated with layout 2. correct?

On layout 2 i have a field that is set to display values from primary key field from table 1. When in layout mode it looks like it is set up right as it shows :(:table1ID.pk. The problem is that when in brows mode the field is empty.

Any ideas?

Link to comment
Share on other sites

You would also need a value in a foreign key in table 2 which was exactly the same value as the value in the primary key in table 1. You must have this foreign key field already, else what did you build the relationship with? But did you put a value in it? It takes 2 keys with identical values (or containing an identical value in one of its multiple lines) to make a relationship, one on each side.

Link to comment
Share on other sites

ok, i understand how to give the fk a value based on the first table. In that example the user selects the fk to use.

I need filemaker to automatical take the value out of the primary key from table 1 and use it as the foregn key in table 2. I am not sure how to pass this value over without the user needing to do anything. This value will change when the record on table 1 is change.

Link to comment
Share on other sites

Well, you can script it; put the current table1 primary key into a Variable (or global field), then go to the layout of table2, create a new record, set the table1_fk foreign key to the captured value, commit record, then return.

Or you can enter data in a portal in table1, with the relationship* allowing creation of related records.

*Based on the table1 key on both sides, table1::table1_pk = table2::table1_fk

The phrase "without the user needing to do anything" is misleading; the user always has to do something, enter data or hit a button.

Link to comment
Share on other sites

This topic is 6113 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.