Results 1 to 7 of 7
  1. #1
    Bvincey2002 is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2013
    Posts
    15

    Combo Boxes


    I am creating a form to track all canceld, and return orders. I have one combo box that is named "Cust ID" and a text box named "Company". The Cust ID is the number associated with the company names. I was able to auto fill the "Company" text box with the Cust ID number by choosing the "Cust ID" from the combo box. I would like to show the company name not the "Cust ID". The "Cust ID" combo box is drawing info from a query that has the draws cust and the company name associate with the Cust ID. Could some one help me with this please.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Sounds like you need to refer to a different column, like here:

    http://www.baldyweb.com/Autofill.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I'm not totally clear about what exactly you want. So, if you want to select and show a name in combo box that is named "Cust ID", change the column widths property. Setting a column to 0cm will make it invisible. However, if you want to select a number in the combo box and then have the Company name that is identified by that number shown in a text box, you will need to set the Control Source property of the text box to something like:
    =ComboBoxName.Column(1)
    The number in brackets identifies which column of the combo box is to be shown. Remember though, that the first column is 0, the second is 1 etc.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    Bvincey2002 is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2013
    Posts
    15
    That expression worked Bob, thank you very much. I do have another issue now. The company name is not being added to the table that the form is bound to? The Cust ID is though. How can I getComapny name to be added to the table? I am newer to Access thank you for the time.


    Quote Originally Posted by Bob Fitz View Post
    I'm not totally clear about what exactly you want. So, if you want to select and show a name in combo box that is named "Cust ID", change the column widths property. Setting a column to 0cm will make it invisible. However, if you want to select a number in the combo box and then have the Company name that is identified by that number shown in a text box, you will need to set the Control Source property of the text box to something like:
    =ComboBoxName.Column(1)
    The number in brackets identifies which column of the combo box is to be shown. Remember though, that the first column is 0, the second is 1 etc.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I do have another issue now. The company name is not being added to the table that the form is bound to? The Cust ID is though.
    Good. That is how it should be.
    How can I getComapny name to be added to the table?
    There is no need to save the name as well as the ID. The tables are for storing data, not for looking at. Although the ID means little if anything to us humans, it should uniquely identify the the company in the companies table. Any time you need details from this table they can be retrieved with a query.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    Bvincey2002 is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2013
    Posts
    15
    Thank you! It works.

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Quote Originally Posted by Bvincey2002 View Post
    Thank you! It works.
    Your welcome. Glad we could help.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Creating Combo Boxes Which Depend On Another Combo Box
    By Durks123 in forum Database Design
    Replies: 10
    Last Post: 07-28-2013, 09:25 AM
  3. Replies: 3
    Last Post: 06-09-2013, 05:35 PM
  4. Replies: 2
    Last Post: 06-03-2013, 11:52 AM
  5. Combo boxes
    By seanh3 in forum Forms
    Replies: 2
    Last Post: 07-20-2011, 10:39 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