Tom,
Just looked at you material.
Here's an alternative you could try.
Code:
Public Sub AddFieldsJ()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim n As Integer
Set db = CurrentDb
For Each tdf In db.TableDefs
If tdf.Name Like "LK_*" Then
If tdf.RecordCount > 1 Then
Debug.Print tdf.Name & " has " & tdf.RecordCount & " records"
'Add [TARGET_STRING] (Text)
With tdf.Fields
Set fld = New DAO.Field
fld.Name = "XYZ" 'Field to be added!
fld.Type = dbText
.Append fld
Debug.Print "Field 'XYZ' added to " & tdf.Name
n = n + 1
GoTo get_next_tdf
End With
End If
End If
get_next_tdf:
Next tdf
Debug.Print "Finished " & n & " tables received new specified field(s)."
MsgBox n & " tables received new specified field(s).", vbInformation, "Status"
Set fld = Nothing
Set db = Nothing
End Sub
When I test your data with this I get these messages.
LK_CIV_MIL has 2 records
Field 'XYZ' added to LK_CIV_MIL
LK_EMERGENCY_ROOM has 4 records
Field 'XYZ' added to LK_EMERGENCY_ROOM
Finished 2 tables received new specified field(s).
jack
Update: It isn't rsLK that you want recordcounts from. You need to evaluate the individual tables whose names are in the rsLK recordset.