Basically what this command button does is it splits a record with 2 words and assigns the 1st word to the original cell and adds a new row but assigns the second word to the new row, but it doesnt work
Set MyConn = New ADODB.Connectio n
MyConn.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=C:\Thesi s\testing\gary\ test1.mdb;"
MyConn.Open
Set MyRecSet = New ADODB.Recordset
MyRecSet.Cursor Location = adUseClient
MyRecSet.Open "SELECT * FROM Table2 ORDER BY tag", MyConn.Connecti onString, adOpenKeyset, adLockPessimist ic
Do Until MyRecSet.EOF
ToBeSplit = MyRecSet.Fields (1).Value
wordset = Split(ToBeSplit , ";")
If UBound(wordset) > 0 Then
For ctr2 = 1 To UBound(wordset)
'THIS IS THE PART I DONT KNOW WHAT TO DO:
ADDNEW ROW
copy myrecset(0) to the myrecset(0) of new row
assign to myrecset(1) the value of wordset(ctr2)
Next ctr2
MyRecSet.MoveNe xt
End If
Loop
MyConn.Close
Set MyConn = New ADODB.Connectio n
MyConn.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=C:\Thesi s\testing\gary\ test1.mdb;"
MyConn.Open
Set MyRecSet = New ADODB.Recordset
MyRecSet.Cursor Location = adUseClient
MyRecSet.Open "SELECT * FROM Table2 ORDER BY tag", MyConn.Connecti onString, adOpenKeyset, adLockPessimist ic
Do Until MyRecSet.EOF
ToBeSplit = MyRecSet.Fields (1).Value
wordset = Split(ToBeSplit , ";")
If UBound(wordset) > 0 Then
For ctr2 = 1 To UBound(wordset)
'THIS IS THE PART I DONT KNOW WHAT TO DO:
ADDNEW ROW
copy myrecset(0) to the myrecset(0) of new row
assign to myrecset(1) the value of wordset(ctr2)
Next ctr2
MyRecSet.MoveNe xt
End If
Loop
MyConn.Close
Comment