Solved

How to set value in field #2 depended from value in field#1

Posted on 2014-10-30
4
12 Views
Last Modified: 2016-07-17
My example:
Table 1
::ID
::Name

Table 2
::ID
::Current_Date
::IDFk (from Table 1::ID)
::NameFk (from Table 1::Name)

I want to set values ::IDFk and ::NameFk in Table 2, but I want just to choose from PopUp list box value (list of Table 1::Name) and value in field Table 2::IDFk should be set up by itself depending on value I will choose from PopUp list.
0
Comment
Question by:Marcin Dudzinski
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
Will Loving earned 500 total points
ID: 40415073
First, set NameFK to Auto-Enter the Name value from Table 1 using on a relationship from Table 2 to Table 1 based on relating Table 2::IDFk to Table 1::ID

Then create a Value List based on Table 1, selecting in the Value List dialog, the Table 1 ID in the left column and the Name value in the right column. Then click the option to "Show values only from second field". Set this as a popup menu on the IDFk field in your Table 2 layout. This will give you a popup menu which displays only the Name but when a name is selected, it populates the field with the ID. Once the IDFk field is populated, the Auto-enter will populate the NameFK field with the related name.

Here's an example: Specify Fiels for Value List
Now that answers your question, but I have a few comments:

1. Unless you have a need to actually copy the Name to Table 2, don't. Just use the relationships based on ID to display the name on the layout or wherever. Once the ID to ID relationship is established you can use it to display any fields in Table 1.

2. Use the same field name for the ID in both tables. And in general, avoid spelling variations in fields that have the same content. You'll find that distinguishing which field is the foreign one is unnecessary and the different names can confuse things and make it harder to determine that you've got the right fields in the relationship. Just use something like CustomerID or ContactID, or if you want to Identify is as a key,  you can use the convention of adding a prefix like "zk_" for "zk_ContactID". The "k" identifies it as a Key field and the "z" forces it to the bottom of the field list so that all keys are grouped. As your relationships get more complex and you have more keys, you'll find it much easier to keep track of things if name like things in different tables the same.
0
 
LVL 24

Expert Comment

by:Will Loving
ID: 41714766
Complete answer provided including screen shot along with some free educational advice about recommended database building practices.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now