Ooops try
DoCmd.RunSQL "UPDATE ID_Generator SET EntityID = " & z & " WHERE EnitityType = 'Company'"
Replace
If DLookup("[EntityID]", "ID_Generator ", "[EntityType] = 'Company'") Then
DLookup("[EntityID]", "ID_Generator ", "[EntityType] = 'Company'") = z
End If
with my one line
Kelvin