Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2014
    Posts
    3

    Unanswered: Copy fields into data entry form from secondary table

    I apologize if this has ever been covered here but I have searched extensively online and cannot find a solution for exactly what I am looking to do.

    Version: Access 2007

    Problem:I would like to have the option to manually input fields in a form (current process) or populate those fields via button. Data would come from a secondary table within same database where the primary key for that secondary table is selected already into a lookup field in the form.

    Scenario: Form 1 is a -current record-data entry- form that works perfectly but I want to now add some user friendliness and efficiency to it. The form is for record entry into my tbl_projects. Tbl_Projects has a primary key [Service#]

    I have a table tbl_Warehouses that stores locations of warehouses that provide services for us.

    tbl_Warehouses contains the fields [WHCode]*primary, [WHName], [WHStreet], [WHCity], [WHState], [WHZip], [WHContact], [WHPhone]

    Back to the form…In the first section of the form we identify the warehouse that is providing the services via a combo box-lookup field to [WHCode] in tbl_Warehouses

    I have the fields for the origination address in Form1 which are [OriginName], [OriginStreet], [OriginCity], [OriginState], [OriginZip], [OriginContact] and [OriginPhone]. As you can see each one has a corresponding field in tbl_Warehouses.

    Currently these have to be manually updated which has to remain an option as sometimes they require a manual address. However other times the Origination address is the Warehouse address that is stored in tbl_Warehouses.

    What I want to do is put a button in the Origination Address section that will ‘on click’ look at the [WHCode] that was selected in section 1 of the form and copy the address fields from the tbl_Warehouses to the fields in Form1/tbl_Projects for the Origin address.

    I hope I have explained this well enough for advice or even a point in the right direction.

    Thanks in advance for any assistance.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Presuming you have the fields in the combo you can use the second method behind the button:

    Autofill
    Paul

  3. #3
    Join Date
    Feb 2014
    Posts
    3
    pbaldy...Excellent that sounds like it should do what I need. I am going to look at this this afternoon when I have a chance to work on the DB. Many thanks!

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    No problem. Sounds like you're a fellow golfer.

  5. #5
    Join Date
    Feb 2014
    Posts
    3
    Pbaldy...I almost forgot to come back and thank you. That definitely solved my problem and your help was greatly appreciated.

    Yep I am a fellow golfer...Although SavinPar is more of a life affirmation (make something good from something bad) than a reflection of my golf game.

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Happy to help, and welcome to the site by the way!
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •