Senin, 23 November 2015

RE: [MS_AccessPros] Re: Form Before_update

 

Sarah


Ah, now that we have all the facts it makes sense as to what was going on. Yes, re-querying the combo is the right way to do it.

-Bill


---In MS_Access_Professionals@yahoogroups.com, <sarahk@schemesoftware.com> wrote :


Bill,

I figured out what the problem with my form was. The combo boxes had  'me.refresh' in the event, Once I took out the 'me.refresh', it stopped trying to update the form prematurely.
The reason for the 'me.refresh' was, because if you clicked the combo box, another form was opened where you could items to the table that the combo box 'pulls' from. Because after the form where the items were added was closed, the new items did not always show in the dropdown, I added 'me.refresh'. I changed it now to  'me.comboxname.requery.
Thanks
Sarah

---In MS_Access_Professionals@yahoogroups.com, <wrmosca@...> wrote :

Sarah

 

Maybe using the exit event of the last control will work for you, but then you'd have to restrict the user from moving off the record until that event fires. You could capture that event with a variable Boolean and then use that Boolean to decide whether or not to run through the form's BeforeUpdate routine.

 

Maybe one of our other members has a better idea. Mine seems to be rather kludgy.

 

Regards,

Bill

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Wednesday, November 18, 2015 1:15 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Form Before_update

 

 

 

It is difficult, because the before update, checks a combination of fields, some of which have not been entered yet.

Sarah

---In MS_Access_Professionals@yahoogroups.com, <wrmosca@...> wrote :

Sarah - Yeah, a form's BeforeUpdate event can be annoying because it fires so often. You have to deal with required fields, actual data being "good" or not, etc. I use each control's BeforeUpdate instead. It takes more coding but I can better control the validations.

 

Regards,

Bill Mosca, Founder - MS_Access_Professionals

Microsoft Office Access MVP

My nothing-to-do-with-Access blog

 



---In MS_Access_Professionals@yahoogroups.com, <sarahk@...> wrote :

I have a form with many text boxes and combo boxes . There is a validation check in the Form_BeforeUpdate.

It works fine, but the 'Form_BeforeUpdate' triggers before all the boxes are filled in, if one of the combo boxes has a table/query as the row source. When it reaches such a field, the Form_BeforeUpdate' triggers.



Is there any way to prevent this? Since it is very annoying to the user, because they are still in middle of filling out the form.

 

Thanks

 

Sarah

 

 

 

__._,_.___

Posted by: wrmosca@comcast.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

.

__,_._,___

Tidak ada komentar:

Posting Komentar