Jump to content
Sign in to follow this  
paulmetzger

show a related field IF....

Recommended Posts

I have a database that identifices species.

The idea is that if we know for sure what the Genus is (a Y/N field denotes this), we can pull the Family and Class out of another database. However, it's not always the case that we're sure the Genus is correct, and in that case we need to be able to manually enter the Family and Class

What's the best way to do this?

My first thought was a calculation (case KnownGenus=Y, Rel::Family,"") , but of course you can't modify calcuation fields.

the other idea I had was to put the above calcuation field *behind* a user editable field, but that might look ugly if the user doesn't change the data after KnownGenus is set to Y

I thought a little about lookups, but we'd really like to keep it a relationship so we don't have to worry about relookups if the master classification database changes

advice?

TIA

Share this post


Link to post
Share on other sites

I always create a calc field in which data cannot be entered. This is where the "final" determination will show up.

Directly behind it is an entry field where the manual entry is done. Since the calc field has user entry disabled, when you click in the field you're actually clicking in the manual entry field behind it.

The calc field returns the calc if the manual entry field is empty; otherwise it returns the contents of the manual entry field.

Share this post


Link to post
Share on other sites

In your case, you can have the calc field return the calc if "Yes" is checked, and the manual entry field if it isn't.

Share this post


Link to post
Share on other sites

ok, that's what I was thinking of doing.

but what if:

"yes" is NOT checked, and the user inputs their own value in the entry field behind

then yes gets checked and the field in front changes to something else. won't I have a garbled mess with two non-empty fields on top of eachother?

Share this post


Link to post
Share on other sites

I do something similiar. Have the calculation field with the default answer. Then have a second field, which is the manual field, that allows you to change it. Then I have a button, that is attached to a script that simply when pushed populates the manual simple text field with the calculated field. So, if I know that the manual field is the default field (or in your case Genius = "yes") then I push the button and populate the field. Otherwise if (Genius = "no") leave blank so user can type it whatever he wants. Of couse I just do not display the calculated field.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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