Jump to content

Populating foreign key via lookup.


fmow

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

Recommended Posts

I am trying to populate a fk. The way I am doing it is that I have a value selected from a list via a field in the parent table, and then have the pk corresponding to it in the parent table looked up and auto entered in the fk field of the child table. It worked for one record, got the right pk to populate the fk, but it's not worked since. What am I doing wrong? 

Link to comment
Share on other sites

I think what you're trying to achieve may be best accomplished with the following:

1. Place the fk field on the parent layout.

2. Define your value list:

    - based on the primary key field

    - choose the option "Also display values from the 2nd field"

    - defind the 2nd field to be the "value" that the user chooses

    - select (optional) "show only values from second field"

3. Note that, in this scenario, setting the fk field Control Style as drop down list vs Pop up field will determine whether the 1st field or the 2nd fields in your value list is displayed when it the field is unselected. 

Link to comment
Share on other sites

Many thanks, esp. for the last (3) tip which I wasn't aware of. That's the initial way I went about it, which I suppose is also the standard way to go about it. I wonder why my current approach isn't working...

Link to comment
Share on other sites

I wonder why my current approach isn't working...

You could post the file here (or a clone) if you want someone to look at it -- or see if you can reproduce the problem in a little test file. 

Link to comment
Share on other sites

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