Results 1 to 8 of 8
  1. #1
    Join Date
    May 2004
    Posts
    159

    Unanswered: yet another combo box question

    I have been trying to figure this out. I have a table that I want to populate with a combo box which uses a query as its recordsource
    eg: SELECT DISTINCTROW [qryEmployeeAlphaList].[Name], [qryEmployeeAlphaList].[emp_ssn] FROM [qryEmployeeAlphaList];
    The bound column is 2
    It works enough to show the name and ssn but the employee name is what shows in the table when I select and view it. On some level the ssn number must be stored there but access always shows me the name from the first column.
    How do I make access show the ssn value and not the name?

  2. #2
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    Look in the format properties of the combobox.
    Is it set for 2 Columns ?
    What are the column widths ?
    if you want the first column hidden and the second to show use 0";1"
    Darasen

  3. #3
    Join Date
    May 2004
    Posts
    159
    To clarify I want the list to show the names first and have the names searched on partial spelling but when selected I want the SSN number to be stored and to show. What I am getting is the SSN number storing but it shows the name associated with it not the number

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by WilliamS
    To clarify I want the list to show the names first and have the names searched on partial spelling but when selected I want the SSN number to be stored and to show. What I am getting is the SSN number storing but it shows the name associated with it not the number
    Hi WilliamS,

    Not too clear on what you are meaning about having a ComboBox used to search for the Name and then Store the SSN? The ComboBox doesn't store anything, just gives you the option of selecting what is already stored in your table.
    In the Properties of your form change your bound column to 1. That way you can scroll through your ComboBox for the Names, but when selected, the Number fills the space. Make sure on the FormatTab you set the ColumnWidths to something like 1";1" or whatever size fits your needs, IF you want to see both fields in the ComboBox for selection. If not then hide whichever you wish in the ComboBox by setting that position to (0). i.e. 1";0". If you are wanting BOTH fields to populate, then make sure you have both fields in your form. Hope this helps you out.

    have a nice one,
    BUD

  5. #5
    Join Date
    May 2004
    Posts
    159
    This is a table with one of the fields set to lookup a query for data using a combo box. The user wants to have the combobox bring up the list of users and their ssn. By using partial complete eg: type in a "mil" to automatically go to millers it has a sort or search functionality. Anyway it works fine to bring up the names but now I want to store the ssn not the name in the field while still using the name to sort by. I though I could just use two columns with the first one the name and bind the second one which has the ssn but I am finding that access97 won't play that way. Even if I make the second column the bound one it will show the first column (name) as the primary identifier even though it is storing the ssn somehow. ( I verified that by some testing and checking)
    I just want a way to force access to show what is actually stored in that field.
    I tried changing the combo box type to value list but that doesn't work either.
    I'm starting to think it is just one of those access97 things and move on to another way of handling it.

  6. #6
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    Just an idea.
    Use two text boxes onm your forms.
    On the first text box have query pull the name and the SSN.
    Have the name as the column that shows but, have the bound column be the SSN.
    For the second combo box have it read something like = [combobox1]
    probally not the most elegant way of doing it but if I am reading you correcty it should work. I attached a very small sample of what I am talking about.
    Attached Files Attached Files
    Darasen

  7. #7
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi Darasen,
    Thats exactly like what I did here in my example. I'm not sure what he is actually doing but what you posted should work. I didn't think to post the one I made but you got it. Like minds.....hehehe

    have a nice one,
    BUD
    Attached Files Attached Files

  8. #8
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Nevermind....didnt see that it did work
    BUD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •