Why .columns.getbyname fails when Form.getbyname works?

LO macro trying to update form fields fails with “No elelment named …” WHY?

Hello,

oForm.getByName("your_control")

gets access to a control on the form.

oForm.Columns.getByName("your_field_name")

get access to the field in the current record for the table associated with this form.

These are two different entities.

You error is stating there is no field named “Reg_Cty” in the table assigned to that form.

Edit:

For control/field updating you may want to look at this post → Table not updating from form when ‘default’ values applied