Results 1 to 5 of 5

Thread: [RESOLVED] Commas in Combobox problem

Threaded View

  1. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    30

    Resolved Re: Commas in Combobox problem

    Well,
    The replace function does work, but not the way you intended it to. I would have to use another character besides a comma in order for it to display. For example a period, but that doesn't look right and I would still prefer displaying a comma. Your idea of replaceing with two commas just makes more rows.

    Anyone else have any suggestions on the issue?

    EDIT: I ended up solving my own problem. What I ended up doing was utilizing the replace function to replace the comma with another comma. Except it was a different character. To help explain better heres my replacement code.

    vb Code:
    1. Do While Not rstORG.EOF
    2.         orgTEXT = (Trim(rstORG!org_desc))
    3.         If InStr(1, (Trim(rstORG!org_desc)), ",") > 0 Then
    4.             orgTEXT = Replace(rstORG!org_desc, ",", Chr(130))
    5.         End If
    6.         cmbOrganization.AddItem (Trim(orgTEXT)) & " (" & rstORG!org_id & ")"
    7.         rstORG.MoveNext
    8.     Loop
    What it does is replace the character 44 with character 130. Which are both commas. But because the combobox/listbox takes the character 44 as a row seperater, this is a workaround. Hope this helps anyone out.

    Thanks,
    ~Chris
    Last edited by ChrisR873; Apr 5th, 2007 at 01:20 PM. Reason: Resolved

Posting Permissions

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



Click Here to Expand Forum to Full Width