Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataCombo Box VB6 Method or data member not found 1

Status
Not open for further replies.

data59

MIS
Jun 30, 2005
17
0
0
US
I have a DataCombo Box on a VB6 form that I’m trying to populate from a procedure that returns a string. It works fine in Access but I get a error “Method or data member not found” in VB6.

Me.combo0.RowSource = GetData
 
I changed my approach and tried the AddItem of the standard ComboBox, I was able to get the first item from my procedure. Now I need help with a loop to read the rest. The data from my procedure returns a string in this format

Data1xxx xxx ; Data2 xxxx xxx ; Data3 xxxx xxx ;Data4xxxx xx xxx;

What I want to do is have and AddItem trigger each time the “ ; ” Semicolon appears in the string.
 
Here is my suggestion...

Code:
Dim sTemp As String
Dim arData() As String
Dim i As Long

sTemp = "Data1xxx xxx ; Data2 xxxx xxx ; Data3 xxxx xxx ;Data4xxxx xx xxx;"

arData = Split(sTemp, ";")
For i = LBound(arData) To UBound(arData)
    Call Combo1.AddItem(arData(i))
Next

Of course, you will have to change the sTemp part so that it uses the data from your procedure.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top