How do replicate form data into multiple fields of table?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bigdaddrock
    New Member
    • May 2010
    • 67

    How do replicate form data into multiple fields of table?

    I have a form that allows for input of new Customer Billing address fields (B1, B2, B3) as well as fields for the Shipping Address (S1, S2, S3).
    Sometimes these are the exact same!
    I have text boxes on the form for all six fields. However, when the Billing and Shipping Address fields are identical, I would like to allow person entering data to only have to do so for the Billing address, and then have the form autopopulate the Ship Address fields with that same data.
    Is there some macro or code that can be written behind a command button to allow this to be done. It would eliminate potential for error in keying in same data twice.
    Note: In many cases the Billing and Shipping Addresses are NOT THE SAME. As such, all six fields will appear on the form.
    Thanks in advance for your assistance.
  • liimra
    New Member
    • Aug 2010
    • 119

    #2
    Solution/

    You can use any of them.

    For Macros, you use the SetValue action (make sure that in macro design view "show all actions" is selected). Then the "Item" is the "ShippingFieldN ame" and the "Expression " is the "BillingFieldNa me". Attach this macro to the "OnClick" event of the button.

    For VB, again you can use the "OnClick" event and use
    Code:
    Private Sub ButtonName_Click()
    ShippingFieldName = BillingFieldName
    End Sub

    Regards,
    Ali

    Comment

    • Bigdaddrock
      New Member
      • May 2010
      • 67

      #3
      Thanks - I forgot about SetValue

      Thanks for the heads up and rapid reply. Worked like a gem.

      Comment

      • liimra
        New Member
        • Aug 2010
        • 119

        #4
        Glad it worked.

        Regards,
        Ali

        Comment

        Working...