0

I'm trying to set a value of a field from a subroutine which I'm calling from an event handler. I'm simply doing width = 5

However, the field value isn't changed. However I can do height = 5 and the field value is set as expected. The field value for width remains unchanged at 12186.

I've tried changing the field name to image_width to no avail.

The form has neither controls height nor width.

What am I doing wrong / why is this one field not changing. I've tried deleting the field and recreating, and I don't see anything on this field that limits the setting of data.

1 Answer 1

1

Every form has an inbuilt property .Width so you can't use that for a field name.

A form doesn't have .Height, since this is a property of the form sections.

image_width shold work, though. Are you sure you edited all relevant settings?
i.e. Table field name, form field Name, form field Controlsource, VBA code?

Sign up to request clarification or add additional context in comments.

1 Comment

If only width was listed as a reserved keyword! As for image_width not working, there seems to be a cache of field names that are made by VBA Access. It seems the only way I can set fields that are renamed / added from a form is by copying the form and using that new form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.