Jump to content

If calculation field


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

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?

Link to comment
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!

Link to comment
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

Link to comment
Share on other sites

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