By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,301 Members | 3,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,301 IT Pros & Developers. It's quick & easy.

AfterUpdate Event Runs Repeatedly (3 times)

P: n/a
jv
Hello,

I have a Service Cancellation form that contain a CancelDate text box.
The text box has an AfterUpdate event that perform a few calculations.
This works fine. However, next to the text box is a calendar button
that would allow users to select a date using a pop calendar form.
This calendar form works great except that I want the textbox's
afterupdate event to run after a date has been selected using the popup
form. So what did was that I made the AfterUpdate procedure Public and
have placed the following line of code in the calendar pop up form:

Eval ("Forms!" & gtxtCalTarget.Parent.Name & "." & txtCalTarget.Name &
"_AfterUpdate")

Which is equivalent to:
Forms!frmCancellation.CancelDate_AfterUpdate

This line of code does work for running the AfterUpdate event....
except that it run it 3 times consecutively. I have no idea why. I
have even try simplifying the AfterUpdate event so that all it does is
display simple "Hello" message box. But it still runs 3 times. But
when I manually enter a date into the text box, the after update event
only run once.
Please help me out if you have any idea why this is happening. Thanks.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"jv" <ju***********@hotmail.com> wrote in
news:11*********************@z14g2000cwz.googlegro ups.com:
Hello,

I have a Service Cancellation form that contain a CancelDate
text box. The text box has an AfterUpdate event that perform a
few calculations. This works fine. However, next to the text
box is a calendar button that would allow users to select a
date using a pop calendar form. This calendar form works great
except that I want the textbox's afterupdate event to run
after a date has been selected using the popup form. So what
did was that I made the AfterUpdate procedure Public and have
placed the following line of code in the calendar pop up form:

Eval ("Forms!" & gtxtCalTarget.Parent.Name & "." &
txtCalTarget.Name & "_AfterUpdate")

Which is equivalent to:
Forms!frmCancellation.CancelDate_AfterUpdate

This line of code does work for running the AfterUpdate
event.... except that it run it 3 times consecutively. I have
no idea why. I have even try simplifying the AfterUpdate
event so that all it does is display simple "Hello" message
box. But it still runs 3 times. But when I manually enter a
date into the text box, the after update event only run once.
Please help me out if you have any idea why this is happening.
Thanks.


EVAL is part of your problem.

If you open the Calendar form as modal as well as popup, you
don't need to place the code in the calendar form, as the code
will wait until the calendar form is closed, Just use the OnClick
Event of the Button. Since the code is in the same module, it
doesn't need to be public.
--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #2

P: n/a
jv
Hi Bob,

I didn't know that the code will wait until the calendar form is closed
since the calendar form is opened as a modal popup. Your suggestion
works great!! Thanks.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.