Results 1 to 3 of 3
  1. #1
    oakhoplite is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2018
    Posts
    9

    Making a value from a column of a drop down list (in a form) appear into a text box

    Hi!
    Can anyone tell me how to make a value from a column of a drop down list appear in a text box? For example, if I have a drop down list in a form that has 3 columns: the customerID, cutsomerfirstname and customersurname. This list contains all the customers from the customers table. When one row is selected, the text box (from the drop down list) takes the value of the customerID. I would like to do a separate text box that will take the value of customerfirstname when a row is selected from the drop down list (so to take the value of the customerfirstname column of the drop down list).

    I am sorry if the explanation was not very clear. Help would be greatly appreaciated!

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Combobox columns are zero based so the 2nd column is column(1)

    Code:
    Me.txtFirstName=Me.comboboxname.Column(1)
    Me.txtSurname=Me.comboboxname.Column(2)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    oakhoplite is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2018
    Posts
    9
    Thank you!

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

Similar Threads

  1. Replies: 7
    Last Post: 01-31-2024, 09:57 AM
  2. Replies: 5
    Last Post: 07-05-2017, 02:36 PM
  3. Making my form have a menu list
    By rajikasimu in forum Forms
    Replies: 1
    Last Post: 03-15-2015, 12:38 PM
  4. Drop-Down list to display remaining text.
    By mnsemple83 in forum Forms
    Replies: 3
    Last Post: 07-18-2011, 10:29 AM
  5. Referencing drop down list from form
    By akyramid in forum Queries
    Replies: 1
    Last Post: 03-01-2011, 05:36 PM

Tags for this Thread

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