J
Jason
Hello,
I've this code which is a workaround to fill combo- or listboxes through
an ado-connection method This is because we don't have access 2003
where you can set the recordset of a combo- or listbox.
The problem is when i use my code, it sometimes fails because of
regional settings where the separator is different than the one i use in
my code.
How can i set the separator to each different regional setting if it occurs?
Here's the codesnippet:
Public Function ListComboBox_Filler(strSource As String)
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strValueList As String
Set cnn = myconnection
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = cnn
.Source = strSource
.Open
Do Until .EOF
strValueList = strValueList & rst.Fields("Value") & ";" & _
rst.Fields("Label") & ";"
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
cnn.Close
Set cnn = Nothing
ListComboBox_Filler = strValueList
End Function
I've this code which is a workaround to fill combo- or listboxes through
an ado-connection method This is because we don't have access 2003
where you can set the recordset of a combo- or listbox.
The problem is when i use my code, it sometimes fails because of
regional settings where the separator is different than the one i use in
my code.
How can i set the separator to each different regional setting if it occurs?
Here's the codesnippet:
Public Function ListComboBox_Filler(strSource As String)
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strValueList As String
Set cnn = myconnection
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = cnn
.Source = strSource
.Open
Do Until .EOF
strValueList = strValueList & rst.Fields("Value") & ";" & _
rst.Fields("Label") & ";"
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
cnn.Close
Set cnn = Nothing
ListComboBox_Filler = strValueList
End Function