Events in the form not triggering

rohnds

Registered User.
Local time
Today, 07:14
Joined
Jul 20, 2010
Messages
19
I have a form with a field that require the user the enter the date. This can be done either by enerting the date or clicking on a command button that opens another form with an Active X MSCAL.Calendar.7
When the user select the date, the date field will be filled by the date selected and the form will be automatically closed.

As soon as the date field is populated, I want use the date information and search the recordset for a specific record. But for some reason the on_change, after_update or before_update event is triggered when the field is populated. Why is this? And how get around this problem.


First time poster and would appreciate any help.
 
Try this:
The your code put in another form (calendar form),
in Form_Close event.
 
The AfterUpdate event, the one usually used for this type of thing, will only be executed if data is physically entered in the textbox, either thru typing in or pasting data into it. When data is entered thru programming, as with the use of the calaendar form, you have to explicitly Call the AfterUpdate sub.

BTW, why do you open a secondary form with the ActiveX Control on it rather than placing it on your primary form and simply controlling it's Visibility?

Linq ;0)>
 
Thanks missinglinq. I got around it by rearranging the field such the date field comes first and the other field (childID) comes second. And I embedded the code I want in the before_update event procedure of the childID
 

Users who are viewing this thread

Back
Top Bottom