auto fill

  • Thread starter Thread starter Crystal via AccessMonster.com
  • Start date Start date
C

Crystal via AccessMonster.com

Hi,

I'm trying to create a command button that you can click that will update
delivery address2 with delivery address1, if delivery address2 isnull. I
have tried iif statements, but would really like to see if I could get a VBA
code for this, as I have a number of them.

-Deliver to
-Address1
-City
-Postal Code
-Country.

Can you help?

Thank you, Crystal
 
Hi,

I'm trying to create a command button that you can click that will update
delivery address2 with delivery address1, if delivery address2 isnull. I
have tried iif statements, but would really like to see if I could get a VBA
code for this, as I have a number of them.

-Deliver to
-Address1
-City
-Postal Code
-Country.

Can you help?

Thank you, Crystal

Try something like:

Private Sub cmdDupAddress_Click()
If IsNull(Me!DeliverTo2) Then
Me!DeliverTo2 = Me!DeliverTo1
End If
If IsNull(Me!Address2) Then
Me!Address2 = Me!Address1
End If
<etc>
End Sub

John W. Vinson[MVP]
 
Back
Top