N
NH
I am using code to clean up a table.
The table is imported from a text file where some rows have been 'wrapped'
so you get data like:
FIELD1 FIELD2
123 James Bond -
0 Live And Let Die
where I want:
FIELD1 FIELD2
123 James Bond - Live And Let Die
The following code does exactly what I want, except I am not sure fow to
'finish' it. When the task is completed, I.e. there are no rows left to
clean, Access returns a 'No Current Record' error.
Do While Not rs.EOF
rs.FindFirst ("FIELD1 = '0'")
StrDATA = rs!FIELD2.Value
rs.Delete
rs.MovePrevious
rs.Edit
rs!FIELD2.Value = rs!FIELD2.Value & " " & StrDATA
rs.Update
Loop
How do I get the code to drop out properly when it has finished the task?
Thanks
Nick
The table is imported from a text file where some rows have been 'wrapped'
so you get data like:
FIELD1 FIELD2
123 James Bond -
0 Live And Let Die
where I want:
FIELD1 FIELD2
123 James Bond - Live And Let Die
The following code does exactly what I want, except I am not sure fow to
'finish' it. When the task is completed, I.e. there are no rows left to
clean, Access returns a 'No Current Record' error.
Do While Not rs.EOF
rs.FindFirst ("FIELD1 = '0'")
StrDATA = rs!FIELD2.Value
rs.Delete
rs.MovePrevious
rs.Edit
rs!FIELD2.Value = rs!FIELD2.Value & " " & StrDATA
rs.Update
Loop
How do I get the code to drop out properly when it has finished the task?
Thanks
Nick