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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

2 questions 2
Combo Box and requery 5
IIF with multiple requirement 8
Visible/Invisible text boxes 1
Table Splitting Questions 7
Too many records 3
checkbox in report 1
Filtering Multiple Values 20

Back
Top