B
bifteki via AccessMonster.com
I have a form connected to a database in SQL Server.
In this form I have a list which is filled in with items the user chooses
from a combobox. These items are fields from the database but because of the
way it's being populated I have made it a Value List.
I have added coded to the double click event of the list, through which the
user removes the selected item from the list. Following is the code:
Private Sub lst_selected_products_DblClick(Cancel As Integer)
Dim selIndex As Integer
If (Not IsNull(lst_selected_products.ListIndex)) Then
If ((lst_selected_products.ListIndex > 0) Or (lst_selected_products.
ListIndex = 0)) Then
selIndex = lst_selected_products.ListIndex
lst_selected_products.RemoveItem (selIndex)
End If
End If
End Sub
Generally it runs OK, but the problem occurs when the item I want to remove
has a comma in its value. The list has 3 columns and for some reason the
comma isn't escaped by Access and considered a delimiter instead. So I end up
with some mixed-up data in my columns.
This is not a problem in Access 2007, as it works fine. I guess it's a bug of
the 2003 version. Does anyone know any solution to this?
In this form I have a list which is filled in with items the user chooses
from a combobox. These items are fields from the database but because of the
way it's being populated I have made it a Value List.
I have added coded to the double click event of the list, through which the
user removes the selected item from the list. Following is the code:
Private Sub lst_selected_products_DblClick(Cancel As Integer)
Dim selIndex As Integer
If (Not IsNull(lst_selected_products.ListIndex)) Then
If ((lst_selected_products.ListIndex > 0) Or (lst_selected_products.
ListIndex = 0)) Then
selIndex = lst_selected_products.ListIndex
lst_selected_products.RemoveItem (selIndex)
End If
End If
End Sub
Generally it runs OK, but the problem occurs when the item I want to remove
has a comma in its value. The list has 3 columns and for some reason the
comma isn't escaped by Access and considered a delimiter instead. So I end up
with some mixed-up data in my columns.
This is not a problem in Access 2007, as it works fine. I guess it's a bug of
the 2003 version. Does anyone know any solution to this?