Updating fields

  • Thread starter Thread starter Jennifer
  • Start date Start date
J

Jennifer

I have the following code:

Private Sub Envelopes_AfterUpdate()

If Envelopes = "Yes" And ShipTo = "Family" Then
EnvelopeStreet = ShipToStreet
EnvelopeCityStateZip = ShipToCityStateZip
Else
EnvelopeStreet = ""
EnvelopeCityStateZip = ""
End If

End Sub

This is supposed to automatically update the
EnvelopeStreet with the ShipToStreet and update the
EnvelopeCityStateZip with the ShipToCityStateZip if the
field Envelopes is "Yes" and the ShipTo field
is "Family".

However, this does nothing. What do I have wrong?
Thanks so much!
 
Jennifer said:
I have the following code:

Private Sub Envelopes_AfterUpdate()

If Envelopes = "Yes" And ShipTo = "Family" Then
EnvelopeStreet = ShipToStreet
EnvelopeCityStateZip = ShipToCityStateZip
Else
EnvelopeStreet = ""
EnvelopeCityStateZip = ""
End If

End Sub

This is supposed to automatically update the
EnvelopeStreet with the ShipToStreet and update the
EnvelopeCityStateZip with the ShipToCityStateZip if the
field Envelopes is "Yes" and the ShipTo field
is "Family".

However, this does nothing.

Is the Envelope field really a text field containing the
string "Yes"? More likely it's a yes/no field that contains
a True or False. If so. try this:

If Envelopes = True And ShipTo = "Family" Then
 
Back
Top