Make the checkbox a button that runs a script - just copies each field into the corresponding field.
Don't need a script.
Set an auto-entered calculation on each field like this:
If ( not IsEmpty ( Checkboxfield) ; Street Address ; Self )
For the mailing address field. Do the same for each such field but refer to a different "street" field as needed.
You can clear the "do not replace existing value..." check box if you want clicking this check box to always copy the data over or you can leave it selected if you only want the data to copy over if the mailing fields are blank.
Thanks Phil! That worked really well... I'd like to add one more thing to that if possible.
As it is right now, I check the box and all the Street Address fields copy into the mailing Address fields, is there then a way so that when I uncheck the box, the fields go blank?
Thanks a lot!
Simply change the expression slightly:
If ( not IsEmpty ( Checkboxfield) ; Street Address ; "" )
Some developers prefer to leave out the last parameter entirely:
If ( not IsEmpty ( Checkboxfield) ; Street Address )
I have one additional question for this. I am now using your calculated value (which works great, btw). previously, I was using a looked up value from a zipcode table that populated City and State based on a Lookup value.
Is there a way that I can continue to use both? For example, if the "Same As Street Address" box is not checked, can I still look up the city and state based on the zipcode table?
As of right now in the Auto Enter menu, it will only allow my to have either Looked Up or Calculated, not both.
Answered my own question! I just made the Address Field and Zipcode field Calculated and the State and City Lookup.
I'd like to renew this for a bit, as there is a glitch when I don't use the checkbox. Currently, I have Street Address and Mailing address fields so that when I check the box, it copies the street address into mailing address fields.
However,when the zipcodes are different from each other and I do not need to use the check box, I enter the zipcode in the mailing zip field, then the street address field. The second the street zipcode is entered, the mailing address zipcode disappears.
I currently have two instances for the zipcode table performing separate lookups for both street and mailing addresses, so I don't' understand why this is happening.
I'd check the settings on those "look ups". With the auto-entered calculations, you shouldn't need any looked up value settings on the same fields.
got it! thanks! I just had an auto calculation left over from trying to figure out the checkbox.