Jump to content
Sign in to follow this  
ddreese

If calculation field

Recommended Posts

The significant other file in my database holds all significant others for a client, like mother, father, siblings, etc. There are multiple fields for address information in this file. Another field in the file is "household member", a yes or no value.

I want the address information to be updated accordingly to the value of this field. If it's 'Yes', then I want the fields to be auto-entered with the address that is currently assigned to the client (a record in 'address-history', keeps each address for the client, the relationship uses a descending-sort to keep the newest address at the top).

So far I've gotten it to work with scripts and two buttons instead of a drop-down field. It works to a point. If I put in a new address for the client, the fields in the significant other file are obviosuly not updated. The fields right now are just plain text fields. I'm using set field in the script to insert the values. If I change the field to calculations, will I be able to enter text into them if the if isn't true???

For instance:

Street Number = (if(household member = "Yes", address_master::street number, "")

Could be a possible field definition if it's a calc field, but they're still not dynamic enough. I can select no, and the information will still stay in the fields, and similarly I can select Yes, and it still doesn't do anything. This needs to be dynamic.

The only other thing I could think of is ghetto-rigging a script to run every time I enter a new address for the client that will update all related records in the sig other file with "Yes" in household member field, but this seems very inefficient to me.

Any ideas?

Share this post


Link to post
Share on other sites

IMO, you're looking for a way to set a default field value, and use that field for a lookup in other related files....

There are a lot of solutions for this, one which I use is a Renumbering Portal, based upon DJ's sampler, which allows to move around a record in a related file.

There was a good thread 2 months ago about setting a "default image". You'll get a lot of answer ther in my opinion.

Here's a link to the thread where, if I remember, Peter Fenner, Russ Baker, Tom Fitch and myself (mine is based upon an old file for a Default Adress setting) provided some attachments with quite different methods...

One demo file for Default Adress

Use UGO for Password. Forget about the ugly container that was here for the thread mentionned above.

Link to the thread!

Share this post


Link to post
Share on other sites

In stead of putting 'yes' or 'no' in the 'household member' field, you could enter the ID of the address record that's the master address. The address fields could then be looked up with the 'don't copy contents if empty' option switched OFF, so that if you remove an entered value from the 'household member' field, the address gets cleared. If that is what you want...

Hope this helps,

regards,

Ernst

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.