Solved

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

Posted on 2014-10-30
4
10 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

706 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

12 Experts available now in Live!

Get 1:1 Help Now