Form.BeforeUpdate vs. cmdButton.Onclick

  • Thread starter Thread starter ZRexRider
  • Start date Start date
Z

ZRexRider

Hi,

Although I thought this was a simple one I found out it was not.

I have a sub-form that has a simple "Info" button that will retrieve
some Pre-fill data for an empty row waiting for data entry. The user
has a choice of just entering all of the information and moving on
which will cause some required field validation in the Before Update
event of the form or clicking this "info" button to pre-load some of
the fields.

Unfortunately, the before update event fires before the Onclick so I
don't get a chance to set a value telling the update to skip the update
and the validation. Resulting in the user getting a message telling
them that they forgot to fill in required values.

Any ideas are appreciated.

Thanks
 
Where is the button? On the subform or on the mainform? If it is on the
mainform the record will be saved before focus returns to the main form. If
it is on the subform there shouldn't be any reason for an update to be
attempted unless the user is tabbing past the last control AND the Cycle
property of the form is set to All Records.
 
Sandra you nailed it! I overlooked the Cycle Property!

The button is on the sub-form and the cycle property was set to All
records.

All working now

Have a great weekend!
 
Back
Top