Results 1 to 4 of 4
  1. #1
    oestmanr
    Guest

    Combo Box selection problem

    I'm using a combo box to query from a different table. When I select a particular value, it concatenates the value if it is too long. Both fields in each table are Memo with no restrictions, but it's still concatenating. Any ideas on how to get around this? Thanks, Ryan Oestmann

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box selection problem

    Do you mean it truncates it? It would help if you explained exactly what you are doing. You can't query anything with a combobox, although you can base a combobox on a query, if that's what you mean.

    Comboboxes are not appropriate for displaying the contents of memo fields. If you just want to display enough of the field value to select it, use something like Left([MemoField],100) to return the first 100 (or whatever) characters from the field to the combobox for the user to see.
    Charlotte

  3. #3
    oestmanr
    Guest

    Re: Combo Box selection problem

    Yes, it truncates it. The combobox is pulling data from a separate table. It truncates the info when you actually pull-down the menu. I'm not so concerned about that, but I am concerned that when you select a line from the combobox, it truncates it into the actual box. I hope that clears up my question. Thanks, Ryan

  4. #4
    Brent
    Guest

    Re: Combo Box selection problem

    Hi Ryan, what's probably happening is that the combo box can't handle a memo field, so it's converting your memo field to the equivalent of a text field, which it can handle and has a maximum length of 255 characters. Thus the truncation. Then when you select the field to populate the box you want it's giving you the truncated string.

    I'm not sure how you're populating the box from the combo box, but it's probably something like this in a button or the AfterUpdate of the combo box:

    Me!txtOtherBox = Me!cboComboBox

    A solution to this (which depends on how you have your table set up) is to have the combo box have two columns, one with the memo field and the other with the key field for the table the memo field is in (which would be hidden and set as the Bound Column). Then, instead of the code above, use code like this (a Dlookup) to populate the other box:

    Me!txtOtherBox = Dlookup("[Memo Field]", "[tblMyTable]", "[Key Field] = " & Me!cboComboBox)

    (Note that the above assumes that the key field is a number, not a string. If it's a string, you'll have to use: "[Key Field] = '" & Me!cboComboBox & "'")

    Let me know if this solves your problem,

    Brent

Posting Permissions

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