If you're saying that if a given Control has data in it then that Record will not allow editing, then, replacing TargetField with the actual name of the Textbox that holds the Field that this will be based on:
Private Sub Form_Current()
If Nz(Me.TargetField, "") <> "" Then
Me.AllowEdits = False
Me.AllowEdits = True
If this is not the situation, you need to explain your need a little more clearly.