Automically populate one field to another but change if necessary

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have a database with a mailing address and ship to address. We want the
mailing address to automatically populate to the ship to address but we want
to be able to change the ship to address, if needed, without having an effect
on the mailing address. The Northwind DB sent with Access does that but we
haven't been able to find how it's done.
 
In the AfterUpdate event of the controls where you enter the mailing
address, copy the values to the ship to address. This will allow you to
still modify the ship to address if you want to. You could also create a
button to do this if you prefer.

Example:
Me.txtShippingAddress1 = Me.txtMailingAddress1

You would do this for each control that contains the address information
(i.e. Street Address, City, State, Zip, etc). If you use a button, you would
fill in all of the address controls then copy all of them in the button's
Click event. You may want to allow for a value already being in the shipping
address.

Example:
If IsNull(Me.txtShippingCity) Then
Me.txtShippingCity = Me.txtMailingCity
End If
 
Hi Kat,

Northwind does it with a few lines of VBA in the AfterUpdate event
prodedure of the CustomerID combobox on the Orders form.
 
Back
Top