Results 1 to 10 of 10
  1. #1
    Access Knowledge is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2017
    Posts
    5

    Autofill a textbox in a form based on the data in a combobox on the same form

    I would like a textbox to be autofilled with the extension number of the employee that is chosen from a combobox in the same form. I have the data all entered in two tables but I cannot figure how to relate the two sets of data so that the textbox will autofill based on the chosen employee. Can someone help me out here? I'm almost pulling my hair out trying to figure out if I went wrong or if I'm just missing a step. Thank You

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,418
    in the rowsource to your combobox, include the extension number. Assuming your combo has three columns (ID, name, extension), you will have hidden the first and last columns and your combo control is called cboEmployee, in your textbox controlsource put

    =cboEmployee.column(2)

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    How about:

    BaldyWeb - Autofill
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    ACK! This is what happens when the phone rings while you're typing, and you don't refresh. Sorry Ajax.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,418
    no need to apologise - happens to me to!

  6. #6
    Access Knowledge is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2017
    Posts
    5
    Thank you guys for your help but I'm still having trouble. What I have is one table title MLS Employee with 3 columns (ID, Name, contact) From their I have a form where the combobox titled "Assigned To" has a lookup feature for the "name". What I would like is the textbox titled "Employee Contact" to fill automatically the "contact" for that specific "name".

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Looks like Ajax is off duty. What exactly does "having trouble" mean? Have you tried the suggestions? Both involve including the desired field in the combo row source, then either copying or referring to that value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Access Knowledge is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2017
    Posts
    5
    I played around with what you guys recommended and what I had and I finally got it to work.
    Thanks again

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Ajax was happy to help and I was happy to pile on.

    Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,418
    Sorry missed the exchange - was out having a life

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

Similar Threads

  1. Replies: 3
    Last Post: 11-22-2015, 11:01 AM
  2. Replies: 10
    Last Post: 10-14-2013, 10:18 AM
  3. Replies: 4
    Last Post: 12-22-2011, 03:04 AM
  4. Replies: 7
    Last Post: 10-31-2011, 02:21 PM
  5. Replies: 4
    Last Post: 01-05-2011, 07:56 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