Calculated field programing help needed

WILYWAYNE11

New member
Local time
, 22:04
Joined
Aug 27, 2022
Messages
20
I have a table that lists the customers address (site address) and mailing address separately. We have included a data base field called "Mailing address same", If the customers address and mailing address are the same (Yes) than the mailing address field is populated with the customers address, thus saving time. We are using a calculated field to address this procedure and it works fine...until the Mail Address Same field is "No". We cannot enter any data into the field at all. I have included the calculated field programing. If there is a way to allow entering data please let me know.
=@IIF ([mail address same]="yes', [site address], " ")
The " " is preventing entry of any data. I can't find a way around this. Excel is much easier that Access
 
Calculated fields are Read Only. Also, I don't recommend data entry directly to the table. To achieve what you want you may need to use forms.
 
This is untested; but instead of using a calculated field, try using that expression in the Default Value property of the mailing address field.

Otherwise, I agree it's best to control this situation using forms.
 
A better structure would be a separate table of addresses, linked to customer and with a flag to indicate type of address - as a customer to a company I can have multiple delivery addresses for example.

The flag can be multi purpose - simplistically for example

1=billing
2=delivery

so a customer where the two are the same you could use a flag value of 12
 
That violates first normal form
I don't disagree, but rules are made to be broken occasionally and I was trying to keep it simple
 
Can you not have the process just use the customer address unless there is a separate delivery address?

That way, if the customer changes his address you don't have to update the changed "default" delivery address, which could get overlooked. I am not sure I would even bother with a "same" address flag.
 
To me calculated fields are one of those features that sound like a good idea but are often more trouble than they are worth.
If there was just one instance of a calculated field falling over at a customer site, you'd never prove how or why. So why go there in the first place?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom