The code needs, I think, to be
If LEN(Me.txt_FieldA & "") > 0 Then
Me.txt_FieldB.Locked = True
Else
Me.txt_FieldB.Locked = False
End If
Otherwise, if you move from a record where txt_FieldA has data, to a record
where txt_FieldA doesn't have data, txt_FieldB will still be locked!
Also, this allows for the possibility of txt_FieldA having data, then (if a
mistake was made, for instance) having that data deleted.
On the chance that your user has already entered data in txt_FieldB before
going to txt_FieldA (users do illogical things!) you might want to include a
line, in the AfterUpdate event, to take out anything already in txt_FieldB:
If LEN(Me.txt_FieldA & "") > 0 Then
Me.txt_FieldB = ""
Me.txt_FieldB.Locked = True
Else
Me.txt_FieldB.Locked = False
End If