I’ve built this little database for tracking report submittals. Really straight forward but I got to wondering. I have a field for Facility Address and a field for Contact Address. Is there anyway I can have the Contact Address default to be whatever is entered in the Facility Address? I need it to not just read “same as above” because I will be using this for a later mail-out. And Copy-n-Paste is getting really old. Why yes, I am lazy.
So, can I make the default value for one text box be what ever I’ve entered in another text box?
It’s not that trivial to do it the way you suggest, but here are a few alternatives:
On the form (you are using a form for data entry yes?), bind some code to the onChange property of the address field you use first that fills in the second address field with the values just typed:
From the form designer, show the properties of the various objects (just right click and choose properties from the list) get the name of the two fields involved from the title of the properties menu.
In the properties of the first text box, choose the event tab and the on Change line, click the ellipsis on the right.
Select code builder from the pop up.
enter the code, which is just:
me!sourcefield = me!targetfield
where sourcefield and target field are the names you picked up above.
save, close and test
alternately (and to my mind better) is to create a “same as over there” button beside the second address field:
from the toolbox, choose the command button, instead of using the macro builder, just click cancel, right click the button created, choose build event and insert the same code as above.
this method prevents possible mishaps with edits later in the process
If that’s not clear enough, let me know and I’ll try again.
Thank you thank you thank you, cousel wolf! And thanks for posting the correction while I’m staring at my screen saying, “Where’d Facility Address go? It was just there and now it’s blank??? Wha??” Now I have a super-duper little button that does the trick. Thanks so much!
And **ultrafilter ** - sometimes a facility has a different mailing address, such as a PO box. The Facility Address is for physical location. Did you not take your psychic pill this morning so you could read my mind? Good point though.