Please correct me if I'm wrong, and if there's a better place to ask, let
me know.
It is my understanding (experimentally verified) that the PriorToReset
event will fire when a new database row is produced for data entry. Inside
this event, I can use the passed in event object to get the Form and from
the form get at the elements of the form.
I named my sub the same as the event it relates to.
Sub PriorToReset(event)
dim Form
dim DateField
Form=event.source
DateField = Form.getByName("Date")
Now I can drop a date into the "Date" field via :
DateField.setPropertyValue("Text",
​"01/04/2015"​
)
​
That date shows up on the screen as though I had keyed it in by hand. Great
so far.
Once I fill out the remaining fields manually, and an attempt is made to
send the data to the database, an error shows up asking to fill in the
mandatory "Date" field. I'm looking at it filled in exactly as I want it,
but somehow the system thinks it's not filled in. If I focus the date field
and backspace over the last digit (5) and then re enter 5 and hit enter,
and then attempt to save the record, it works. Why?
​Why can I see the date field filled in exactly as I want it, but somehow
the system thinks the field is empty or somehow invalid until I touch the
field and tinker with its last digit. If I set the last digit to 9, for
example, a database row is stored with 01/04/2019 in it as expected.