You would need to compare your results for each field you find in your rs. So a second DAO recordset should be created. Here I use the FindFirst method using the field's index. With that we can compare the values in the table. You could probably expand on this by not soft typing the table names. Maybe loop through each table when you are doing the field enumerations and then call this code in a function, passing the table name to the UDF. Anyway....
Code:
On Error GoTo Err_Find_Type
strTable = InputBox("Enter table name")
Dim intType As Integer
intType = 0
Dim rsFindField As DAO.Recordset
Set rsFindField = CurrentDb.OpenRecordset("SELECT * FROM tblDefs " & _
"WHERE([tblDefs].[TableName]) = '" & strTable & "'", dbOpenDynaset)
If rsFindField.EOF Then
MsgBox "You did not populate your definitions table! Request aborted."
rsFindField.Close
Set rsFindField = Nothing
Exit Sub
End If
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM [" & strTable & "]")
While Not rs.EOF
rs.Edit
For i = 0 To rs.Fields.Count - 1
rsFindField.FindFirst "[FieldPosition] = " & i
If Not IsNull(rsFindField![FieldType]) Then
intType = rsFindField![FieldType]
End If
Select Case intType
Case 10, 12 'Will select only text, hyperlink, and memo field types
If rsFindField![IsUnique] = 0 Then 'Not Unique Index and can be updated
rs.Fields(i) = Nz(rs.Fields(i), "NULL")
End If
Case 3, 4 'Will select only integer and long integer types
If rsFindField![IsUnique] = 0 Then 'Not Unique Index and can be updated
rs.Fields(i) = Nz(rs.Fields(i), 0)
End If
'You can add other clauses for additional Data types like Yes/No
End Select
Next
rs.Update
rs.MoveNext
Wend
rsFindField.Close
Set rsFindField = Nothing
rs.Close
Set rs = Nothing
Exit_My_Error:
Exit Sub
Err_Find_Type:
If Err.Number = 3022 Then
Resume Next
Else
MsgBox Err.Number & ": " & Err.Description
End If
Resume Exit_My_Error