Kamis, 26 Februari 2015

Re: [MS_AccessPros] Updating shipping and billing addresses

 

Sorry, my name is Karen.  Thanks for the code.  It works great!

Sent from my Verizon Wireless 4G LTE DROID


"John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:

 

Dear k2j1203 (name?):


Private Sub SameShipAdd_AfterUpdate()
    ' If checked same address,
    If Me.SameShipAdd Then
        ' Copy address from the outer form
        Me.BillAddress = Me.Parent!OrgAddress
        Me.BillCity = Me.Parent!OrgCity
        Me.BillState = Me.Parent!OrgState
        Me.BillZip = Me.Parent!OrgZip
    End If
End Sub

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Feb 26, 2015, at 4:37 PM, k2j1203@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hello everyone.  I hope everyone is doing well today.  My question today has to do willing billing and shipping addresses.  What I'm trying to do is update the billing address if it's the same as the shipping address - like they do when you're purchasing things online.  I have a form and a subform.  The main form has the company information with the address information - the shipping address.  I then created a subform which I want to store the billing address.  In the subform I placed a checkbox for the users to check if the addresses are the same.  When the box is checked, I want the billing address to update to the shipping address.  And if it's unchecked, I want to be able to type in the correct address.  


I thought about running an update query but then Access would update all of the addresses pertaining to the customer.  So, I'm at a lose as to how to accomplish this.  Here are my table and field names.


Main form is based on Customers table (the shipping information) - the fields are:

OrgID_PK

OrgName

OrgAddress

OrgCity

OrgState

OrgZip


The subform is based on the Orders table (the billing address information) - the fields are:

OrgID_FK

OrderID_PK

BillAddress

BillCity

BillState

BillZip

SameShipAdd (checkbox)


Hopefully I explained what I want to happen well.  Any help is much appreciated.


__._,_.___

Posted by: Karen <k2j1203@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar