[AccessD] OnUpdate not firing

John Clark John.Clark at niagaracounty.com
Fri Mar 8 10:41:30 CST 2013


I just took the code from the "After Update" of the date, and I duplicated it into the "After Update" of the Mileage field. It can't figure the total amt of payment until it gets that anyhow. I should probably remove it from where it was, but I'm hesitating for now...I'll do that last, so I know to put it back if it messes something up. It seems to be working now though. 

>>> Gary Kjos <garykjos at gmail.com> 3/8/2013 10:03 AM >>>
From:

http://msdn.microsoft.com/en-us/library/office/aa211341%28v=office.11%29.aspx
<http://msdn.microsoft.com/en-us/library/office/aa211341%28v=office.11%29.aspx>

The Change event occurs when the contents of a text box or the text
portion of a combo box changes. It also occurs when you move from one
page to another page in a tab control.

and

Setting the value of a control by using a macro or Visual Basic
doesn't trigger this event for the control. You must type the data
directly into the control, or set the control's Text property.

So you can try moving the date to the text property of the control and
see if that works.

GK

On Fri, Mar 8, 2013 at 8:52 AM, John Clark <John.Clark at niagaracounty.com> wrote:
> OK, I'm sure this is an Access 101 question, and I'm missing something easy here. Please forgive me, as I've recently explained, I've not done much w/Access in a couple of years now, and I think some of my knowledge has purged itself...or it is at least slow at being recollected...
>
> My current project is a small program for the District Attorney's office. It creates a payment voucher for trial witnesses. It is a pretty cool little program, but I actually wrote it 3 yrs ago...December of 2009. They did not get approval that they needed, from the state, to use this program, so it was put off. It was originally suppose to go live, on January 2, 2010. Then it got put off again...and again...and again...until it was eventually forgotten about. Last month, they came to me and asked if I still had that program out there. I dug it up and made a few modifications, and it is going live next week...I hope.
>
> Anyhow...one of the pieces I have not touched is not working. It made it through an initial set of test data, w/out coming out. I got a bit lazy w/the testing, because it was tested pretty thorough back w/I initially did it, and to be honest, I'm quite busy w/out this thing, these days. I'm quite friendly w/a couple of the people in the DA's office, so I fit it in as sort of a favor to them...it is a good idea to have friends in the District Attorney's office, you understand?
>
> Here is the issue...
>
> It basically a 1-form application, and after putting in the data, you press a button that creates a printed voucher. When you open that form, focus goes immediately to the Witness' last name field. There are two fields above it: Voucher Number, which is auto and does not get focus, and the date, which also eludes focus...it is the current day's date. The "OnChange" event of that data tells the form to fill in the current mileage rate, and witness fee, based on the date value...these rates can, and probably will change in the future, and we wanted it to roll w/the change...yet, be able to look up old rates and such if necessary.
>
> The date does not fill in until you start typing that last name...as soon as you hit the first key, the date appears in its filed. But, that does not fire the OnChange event, I guess, because those rates never fill in. Because the rates do not fill in, an amount is never calculated, and you get an error, and then a blank voucher, w/you click on that button to create it.
>
> I'm sure I can muddle through and fix this somehow, but I want to know what I am doing wrong, and how I should be doing this instead. I don't know why I did it this way, but the date is coming from the default setting (now())...should I instead be setting it in the OnCurrent, or OnLoad even of the form? Or maybe from the LastName field?
>
> This was written in Access 2007, but I am now using 2010.
>
> Notice: This electronic transmission is intended for the sole use of the individual or entity to which it is addressed and may contain confidential, privileged or otherwise legally protected information. If you are not the intended recipient, or if you believe you are not the intended recipient, you are hereby notified that any use, disclosure, copying, distribution, or the taking of any action in reliance on the contents of this information, is strictly prohibited. Niagara County is not responsible for the content of any external hyperlink referenced in this email or any email.
> IF YOU HAVE RECEIVED THIS TRANSMISSION IN ERROR, PLEASE NOTIFY THE SENDER IMMEDIATELY BY EMAIL AND DELETE THE ORIGINAL MESSAGE ALONG WITH ANY PAPER OR ELECTRONIC COPIES.
> Thank you for your cooperation.
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



-- 
Gary Kjos
garykjos at gmail.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


Notice: This electronic transmission is intended for the sole use of the individual or entity to which it is addressed and may contain confidential, privileged or otherwise legally protected information. If you are not the intended recipient, or if you believe you are not the intended recipient, you are hereby notified that any use, disclosure, copying, distribution, or the taking of any action in reliance on the contents of this information, is strictly prohibited. Niagara County is not responsible for the content of any external hyperlink referenced in this email or any email. 
IF YOU HAVE RECEIVED THIS TRANSMISSION IN ERROR, PLEASE NOTIFY THE SENDER IMMEDIATELY BY EMAIL AND DELETE THE ORIGINAL MESSAGE ALONG WITH ANY PAPER OR ELECTRONIC COPIES. 
Thank you for your cooperation.


More information about the AccessD mailing list