Ship labels

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

Guest

i have a basic ship label prg. w/ a 'Sold To' and a 'Ship To'.

if the 'Sold To' is the same as the 'Ship To' i want the user to check a box
that will autofill the 'Ship To' for the report.

can someone help, please.

//frank

ps. thanks in advance
 
I do the same with Street (sold to) and Mailing (ship to) addresses. here is
the code I use. MailingAddressSameAsStreet is a check box bound to a yes/no
field in the table. I also disable the mailing (ship to) address so it
doesn't accidentall get out of synch with the street (sold do) address

Private Sub MailingAddressSameAsStreet_AfterUpdate()
If Me.MailingAddressSameAsStreet = True Then
Me.MailingAddress1 = Me.Address1
Me.MailingAddress2 = Me.Address2
Me.MailingCity = Me.City
Me.MailingState = Me.State
Me.MailingZip = Me.Zip

Me.MailingAddress1.Enabled = False
Me.MailingAddress2.Enabled = False
Me.MailingCity.Enabled = False
Me.MailingState.Enabled = False
Me.MailingZip.Enabled = False
Else
Me.MailingAddress1.Enabled = True
Me.MailingAddress2.Enabled = True
Me.MailingCity.Enabled = True
Me.MailingState.Enabled = True
Me.MailingZip.Enabled = True
End If
End Sub

Also when updating any of the steet address (sold to) controls you need to
keep the mailing (ship to) address in synch.

Private Sub Address1_AfterUpdate()
If Me.MailingAddressSameAsStreet = -1 Then
Me.MailingAddress1 = Address1
End If
End Sub


Enjoy
Tony Vrolyk
 
You may also want to add the portion of the code that effects the enabled
status to the On Current or On Open event of the form. That way the fields
are enabled or disabled accordingly when the form is opened or moved to a
new record.

Glad to help
 
Back
Top