Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2008
    Posts
    114

    Unanswered: Combo box storing clientID not ClientName

    Hello..
    I have no idea how this is happening.
    I have a form with a subform.
    The combobox on the form takes the subform to the specified record... Great
    But the combobox itself is then storing the ClienID in the ClientFirstName field in the tbl_Client

    Which is:
    ClientID
    ClientFirstName
    ClientLastName
    Address..... ETC.....

    Hope I explained this well enough

    Tracy

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    isn't that what it should be storing........ the clientID, not the name.
    you can always retrieve the name given the clientID, but you cannot guarantee the other way round.

    ie there may be more than one Tracy Gwyar, but (assuming they are unique individuals and not a data cockup) they will have different ClientID's.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2008
    Posts
    114
    Well I dont know about that..
    The combo box is pulling the client first name. but as soon as you choose another client the first one you tried has change from the clients name.. to the ClientID
    Like...
    It shoud be:
    Tracy Gwyar, but it changes it to 5(or whatever) Gwyar.
    Yes, changes the text name to a numeric value...

    Tracy

    Thanks for getting back to me btw

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so is the problem what the combo box is storing, or what the combo box is displaying? there is a difference
    the combo (or list) box is fine for displaying English, or even Welsh!, names so that it makes sense to the user, but storing the ID which makes sense in terms of data.

    what is it that is setting the value. it may be that you need to set the value rather than the text properties
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jan 2008
    Posts
    114
    Now how did you know I was Welsh????
    Anyway..
    It displays the name fine.. You just choose a name and the form and subform do what they are supposed to.

    The problem arises when you go to select another client from the list.
    The clients name you first selected has been replaced by a number.

    Dropdown should look:

    Tracy
    Bob
    Carl
    Asia
    Steve
    etc...

    But if I select Tracy and then go back in to select another, Carl, all looks fine, until you click the dropdown again
    Then is looks like this:

    5
    Bob
    Carl
    Asia
    Steve
    etc...

    And then if I choose another name, steve, it looks like this:

    5
    Bob
    9
    Asia
    Steve
    etc...
    So on and on until all you have are numbers.
    The table where the data is stored has ClientID, ClientFirstName, etc for fields
    But instead of it saying

    ClientID 5
    ClientFirstName Tracy

    ClientID 5
    ClientFirstName 5

    Im confused

  6. #6
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Check the rowsource of the combo and the recordsource.

    Also check whether there is any code behind the afterupdate event of the combo?
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  7. #7
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can retrieve information from the combo using this syntax:

    <Name> = Me!Combo1.Column(1).Value

    This assumes that the RowSource of the combo is something like:

    SELECT ID, Name FROM <Table>....

    Have a nice day!

Posting Permissions

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