Access Forms

  • Thread starter Thread starter aedom1
  • Start date Start date
A

aedom1

How do I set a form to automatically copy the data from a physical address
field to a mailing address field on a form when I enter the physical address
information if the mailing address information is currently blank?
 
How do I set a form to automatically copy the data from a physical address
field to a mailing address field on a form when I enter the physical address
information if the mailing address information is currently blank?

Let's say you have a textbox txtPhysicalAddress and another txtMailingAddress.
You can view the Properties of txtPhysicalAddress; select the After Update
property on the Events tab and click the ... icon by it; choose Code Builder.
Access will put you into the VBA editor with the Sub and End Sub lines
provided. Edit it to

Private Sub txtPhysicalAddress_AfterUpdate()
If Len(Me!txtMailingAddress) = 0 Then ' is mailing address blank?
Me!txtMailingAddress = Me!txtPhysicalAddress
End If
End Sub
 
Back
Top