AfterUpdate not working (1 Viewer)

stinej

Registered User.
Local time
Today, 12:59
Joined
Feb 21, 2004
Messages
23
Hi,

I'm probably overlooking something quite simple, but here's my problem.

I am using Mile's pop up calendar to populate a text field with a date, this works fine. On the AfterUpdate of that field I have two subforms requerying, the problem is that it isn't working. The date changes and the requery never happens - I tried to use the Change event as well, but this didn't work either.

The two subforms are build from queries and I am sure I'm calling them properly as I had it working when I was using the date time picker, however I abandoned the date time picker for the pop up calendar as I was having trouble packaging the database with that particular active x control.

Any thoughts as to why this might not be working would be greatly appreciated.

Thanks,
J
 

Pauldohert

Something in here
Local time
Today, 12:59
Joined
Apr 6, 2004
Messages
2,101
After the code that calls the calender ( i am presuming this opens dialog) -Put in lines of code to requery the subforms.

(the update event wont run if the value is changed in code)
 

stinej

Registered User.
Local time
Today, 12:59
Joined
Feb 21, 2004
Messages
23
Pauldohert said:
After the code that calls the calender ( i am presuming this opens dialog) -Put in lines of code to requery the subforms.

(the update event wont run if the value is changed in code)


Thanks, I was thinking this... The problem here is that I use the calendar with the module in many different places (I call the module whcih launches the calendar) so I guess I'll have to code a new calendar as well.

Thanks again.
J
 

Pauldohert

Something in here
Local time
Today, 12:59
Joined
Apr 6, 2004
Messages
2,101
However you call the calender try the requery of the subforms the line after - - unless I'm misunderstanding you shouldn't have to change any of the calendar at all.
 

stinej

Registered User.
Local time
Today, 12:59
Joined
Feb 21, 2004
Messages
23
Pauldohert said:
However you call the calender try the requery of the subforms the line after - - unless I'm misunderstanding you shouldn't have to change any of the calendar at all.

The problem I'm having is that I am calling the calendar on the onclick event of the textbox - as a result, if I add the lines to requery the subforms it does it only when I initially click the text box, not after the new value has been added.
 

Pauldohert

Something in here
Local time
Today, 12:59
Joined
Apr 6, 2004
Messages
2,101
Try changing the code which opens the calender to open it dialog - so the code stops running until the calender is closed (I am presuming this is a access form all of its own) then when the subform requeries the date should have already been changed

DoCmd.OpenForm , "formname", , , , acDialog
 

stinej

Registered User.
Local time
Today, 12:59
Joined
Feb 21, 2004
Messages
23
Thanks for your help Paul! I got it to work, I actually ended up placing a calendar control on the form itself, and setting it's default to hidden, then when nI click on the date it unhides the calendar until the user selects a date - then it refreshes the queries.
 

Users who are viewing this thread

Top Bottom