Put together:
Me.TXTUC = DLookup("[Unit Code]", "UNIT", "[unitid] = 'CMP001'")
If you want unitid parameter to be dynamic, reference control that contains value:
Me.TXTUC = DLookup("[Unit Code], "UNIT", "[unitid] = '" & Me.tbxUID & "'")
Why do you need to save Unit Code if you have UnitID in record? Retrieve Unit Code in query joining tables.
Advise not to use spaces in naming convention.