X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Any Way To Enforce Subfrom Edits From Main Form, Access 2013    
post Oct 12 2017, 03:35 PM

Posts: 12
Joined: 5-February 17

In my Access 2013 application I have a mainform 'frmDocumentDefinition' with two subforms 'frmDocumentInterestedParties_Sub' and 'frmDocumentTriggeredCosts_Sub' on it.

The two subforms are continuous forms. Within the subforms I have an edit routine in the 'before update' event for each record entered or updated on the subforms to make sure that all required fields have been entered on each line. The edits work and put out messages for any errors encountered. While working only in the subform the user cannot go to another line until all the edits for the current line are passed.

The problem occurs when users clicks anywhere on the main form while working on an incomplete line in one of the subforms. When that occurs:

The subform edits are invoked and any subform error messages are displayed " Cost Date is a required field."

However, after the error message from the subform is displayed the focus shifts to the main form. The bound subform record is saved but it has the errors in it. For example: required fields are blank.

How do I stop the subform from losing focus when there are edit errors on the subform?

How can I make sure the edits on the subforms are enfoorced from the the main form?
Go to the top of the page
post Oct 12 2017, 03:39 PM

Access Wiki and Forums Moderator
Posts: 71,564
Joined: 19-June 07
From: SunnySandyEggo


It sounds like you're not canceling the BeforeUpdate event when the entry is incomplete and thus Access allows the focus to go to the main form. Can you show us your full code? Do you have something like Cancel = True in it?

Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    21st February 2018 - 08:15 AM