Again: Can't have VBA behind tables and queries. Build a form to use as a subform. The form will be the SourceObject of the subform container control.
Code goes in the AfterUpdate event of [Local X] textbox on subform.
Why using LIKE operator? LIKE is only useful with wildcards. Just use =.