Results 1 to 2 of 2
  1. #1
    Bkndbrown is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    22

    Auto fill form from linked Excel

    The pertinent part of the database has 2 tables and a linked excel. There are more but this is the part I am stuck on.
    Table 1 has Individual Names units and key field
    Table 2 has Administrative Actions that was taken against the names listed in Table 1 linked by that key field
    Linked excel is a roster that we pull out of another system. It has all personal information on everyone. (gender, Rank, Bday, the key field linked to both Table 1 and 2) I was using this as a linked excel to make it easier for others to update the roster by just swapping it out when a new roster is released.



    I have to load the personal information from the linked excel into Table 2 with the Administrative Actions. Typically I would just have all of this info in Table 1 with the name but that will not work in this case. This is because for instance I don’t need to know how old you are now. I need to know how old you were when you received that action.

    On my data entry form I would like to use a combo box to select a person. Then I would like it to automatically populate the fields on the form that will be stored in Table 2 when it is saved, with data that is pulled from the linked excel.

    Again I am extremely novice, I am sure I am missing something easy that I am missing. but trying to learn.

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    The easiest is to make sure the combo's row source includes all the fields you want to populate (you don't need to show them, just set the column width to 0 for the ones you want to hide but make sure you accurately set the number of columns property).
    Then in the after update event of the combo you should prompt if the user want to update\populate then use something like this pseudo-code:
    Code:
    Me.txtRank=Me.cboName.Column(n) 'would populate txtRank textbox bound to Rank field with the value from column n of the combo's row source -keep in mind that the column collection is 0 based so if n=2 it will actually be the third column
    Me.txtGender=Me.cboName.Column(m) '....
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Auto fill Excel Column
    By DMT Dave in forum Access
    Replies: 1
    Last Post: 01-19-2020, 10:07 AM
  2. auto fill form, or something
    By ckra81 in forum Forms
    Replies: 7
    Last Post: 03-20-2017, 08:15 AM
  3. Replies: 7
    Last Post: 09-26-2016, 08:53 AM
  4. Replies: 2
    Last Post: 04-15-2014, 10:03 PM
  5. Auto Fill a form
    By Suzemt in forum Access
    Replies: 3
    Last Post: 02-18-2013, 11:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums