Hi there
I need help, please!
With the code below I add a set of records into a table tblDNAProfile.
The added record have a null value in the DogID field.
Next I want to update the DogID field in those records with the current DogID value.
I don't get any errors and it does not update those records.
What am I doing wrong?
I need help, please!
With the code below I add a set of records into a table tblDNAProfile.
The added record have a null value in the DogID field.
Next I want to update the DogID field in those records with the current DogID value.
I don't get any errors and it does not update those records.
What am I doing wrong?
Code:
Dim DogID As Long
Dim rs As Recordset
Dim Reccount as long
DogID = Me.cboName.Column(0)
Reccount = DCount("*", "tblDNAProfile", "dogid=" & DogID & "")
If Reccount = 0 Then
CurrentDb.Execute ("INSERT INTO tblDNAProfile SELECT dnatestid, dnacategoryid, dnatypeid FROM tblDNATests"), dbFailOnError
End If
Set rs = CurrentDb.OpenRecordset("tbldnaprofile")
rs.MoveFirst
Do Until rs.EOF
If rs!DogID = "" Then
rs.Edit
rs!DogID = DogID
rs.Update
End If
rs.MoveNext
Loop
Set rs = Nothing