Replacing Null fields in Access Records column - VB6
I have an Access database with a table that I have added a new column. Data has been added to that column since it has been created. Most, but not all fields in this column do not contain any data. I have tried creating a little program to insert the value "0" into the Null fields, but have had no success:
Code:
Private Sub Command1_Click()
With Data1.Recordset
.MoveLast
.MoveFirst
Do Until .EOF
.Edit
If .Fields(txtColumn) Is Null Then
.Fields(txtColumn) = txtValue
myCount = myCount + 1
End If
If .Fields(txtColumn) = "" Then
.Fields(txtColumn) = txtValue
myCount = myCount + 1
End If
If .Fields(txtColumn) = " " Then
.Fields(txtColumn) = txtValue
myCount = myCount + 1
End If
.Update
.MoveNext
Loop
MsgBox (myCount & " of " & .RecordCount & " records modified.")
End With
End Sub
Can anyone tell me where I am going wrong? (Yes I know about Select Case. The code will be simplified once I find out the problem).
.
PC - Ubuntu 15.04 64bit Desktop
HP Pav G60-236US 3GB RAM Laptop, Ubuntu 15.04 64bit and Win7 Home
"So Daddy, how come you telling me stealing not right when YOU copying DVDs? How come? How Come?"
RIP Ramesh ...