Lebans Calendar Control

S

Sprinks

I have a continuous subform embedded on a main form. The Totals query
underlying the subform calculates the total number of hours and their value
based on each staff member's BillingRate.

The subform is linked to the main form by the ProjectNumber.

There is query criteria that references two textboxes on the main form that
hold the starting and ending date of the period to be examined. I am
attempting to use Steven Lebans fantastic calendar control to select the
start and end dates, afterwhich I want to requery the subform, but for
reasons I don't understand, changing the date does not trigger the OnUpdate
event.

Does anyone know why and/or know of another event I can use?

Thank you.

Sprinks
 
R

ruralguy via AccessMonster.com

Programmatically changed controls do not trigger events in the control, only
user actions will do that.
 
S

Steve

Call your update code in the code that changes the date in your textbox
after you change the date. Something like:

Me!NameOfTextbox = >>Calendar Date>>
Call Sub NameOfTextbox_AfterUpdate
Me!NameOfSubformControl.form.requery

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
A

Arvin Meyer [MVP]

Filling a control by using code does not trigger any of the events for that
control. In most cases, you can add the code you want to the code you are
using to fill the control. In this case, I'm not sure that's possible. You
may need to use the ActiveX calendar control that comes with Access so that
you have a single instance of code. There is an example at my website:

http://www.datastrat.com/Download/XCalendar2K.zip
 
S

Sprinks

ruralguy, Steve, and Arvin,

Thank you for explaining why the events did not trigger and for your
suggestions. In this case, putting the .requery code in the control's own
Double_Click event which calls the Calendar control works great.

Sprinks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top