Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    4

    Combox box returns ID number in table instead of names

    Hello everyone,

    Hope someone can help.
    I build a combo box in a form that selects customers names from the customers table. On the form, no problems. However, if I look in the table, the customer's id is stored in the field, not the name.


    Of course, that has an impact on the queries and reports extracted from that table in that all show customer id instead of name.

    Your help would be much appreciated, thank you.

  2. #2
    Join Date
    Jan 2009
    Posts
    4

    No help? :(

    Perhaps the follwing will clarify my problem better, in the hope that someone can help.
    I have built a work order database from scratch (perhaps that is my problem? ).
    When adding a new order for a particular customer, the form I built is extracting information from several tables, one of them being Customers table(ie. extracts customer name from customers table via a list box)
    Everything is fine when viewed in form (ie. extracts the customer name from the customer table).
    Problem comes when storing that data in the "orders" table. Instead of populating the fields with the actual name, it enters the customer's ID (extracted from the Customers table). Of course, my queries and reports are displaying the same thing - the customer id number, not the name. What am I doing wrong? How can I rectify that?
    Your help would be much appreciated.
    Thank you.

  3. #3
    Join Date
    Feb 2009
    Posts
    14
    Here are a couple things that I thought of.

    Check the following Properties of the Combo via right click on combo in Form Designer.
    - Control Source
    - Row source Type
    - Row Source
    - Column Count
    - Column Widths
    - BoundColumn
    Sometimes the data assigned to the control is multiple fields (columns) and some may be hidden by setting their column width to 0.

    What vba code are you using to assign from the combo?
    Typically either the .Column(0) or .ItemData(0)
    properties are used to get at combo data via index.
    The correct index is required especially when fields are hidden via zero width columns.

    Me.ComboSubdivisions.Controlsource = SubdivisionID
    Me.ComboSubdivisions.RowSourceType = Table/Query
    Me.ComboSubdivisions.RowSource = "SELECT [Subdivisions].[SubDivisionID], [SubDivisions].[SubDivisionName] FROM Subdivisions WHERE [Subdivisions].[DivisionID]=[Forms]![MaintenanceForm]![ComboDivisions];"

    Me.ComboSubdivisions.ColumnCount = 2
    Me.ComboSubdivisions.ColumnWidths = 0";2"
    Me.ComboSubdivisions.Boundcolumn = 1


    sSubDivisionID = Me.ComboSubdivisions.Column(0)
    sSubDivisionDesc = Me.ComboSubdivisions.Column(1)


    I hope that this is helpful.

  4. #4
    Join Date
    Jan 2009
    Posts
    4
    Quote Originally Posted by blackduck603 View Post
    Here are a couple things that I thought of.

    Check the following Properties of the Combo via right click on combo in Form Designer.
    - Control Source
    - Row source Type
    - Row Source
    - Column Count
    - Column Widths
    - BoundColumn
    Sometimes the data assigned to the control is multiple fields (columns) and some may be hidden by setting their column width to 0.

    What vba code are you using to assign from the combo?
    Typically either the .Column(0) or .ItemData(0)
    properties are used to get at combo data via index.
    The correct index is required especially when fields are hidden via zero width columns.





    I hope that this is helpful.


    That is exactly what it was. Thank you very much for your effort, I was starting to wonder

    Regards,
    JP

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

Similar Threads

  1. Setting up User names and passwords
    By knightjp in forum Security
    Replies: 2
    Last Post: 02-05-2009, 10:18 PM
  2. Replies: 1
    Last Post: 02-05-2009, 04:53 PM
  3. Replies: 1
    Last Post: 01-31-2009, 10:43 AM
  4. Hard Returns v. Squares
    By Goodge12 in forum Queries
    Replies: 3
    Last Post: 01-28-2009, 10:10 AM
  5. How to extract names from 1 large field
    By Tepin in forum Access
    Replies: 1
    Last Post: 12-04-2006, 01:14 PM

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