I am using a pop-up calendar form, to put a date in a textbox. The textbox
has an After Update event, [Forms]![Daily Summary]![Child2].Requery. When the
calendar closes, the date is entered into the textbox but the form does not
update. Even if I put the curser into the textbox after the calendar has
entered the date and the press the enter key, nothing updates.
However, if I type in the date and press enter the form up dates.
I have tried deleting the textbox and calendar and then redoing but I cannot
get it to work again.
I have used the same setup successfully in other forms within the same
database but cannot pick what is missing.
I hope someone can help.
Regards
Nick
Hi Nick,
Try inserting code in your calendar's click event procedure to force the
requery. For example, here is a procedure I use in an unbound Query by Form
(QBF) in conjunction with Allen Browne's calendar:
http://allenbrowne.com/ser-51.html
Private Sub cmdFromDateRaised_Click()
On Error GoTo ProcError
Call CalendarFor([txtDateRaisedStart], "Starting Request Date")
RequerySubform
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure cmdFromDateRaised_Click..."
Resume ExitProc
End Sub
In my case, the RequerySubform procedure is a function that is called from
the After_Update event procedure of combo boxes, text boxes, list boxes, etc.
on my QBF form. As you can see, I also call it from the click event for the
command button that opens the calendar form.
Tom Wickerath, Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
> I am using a pop-up calendar form, to put a date in a textbox. The textbox
> has an After Update event, [Forms]![Daily Summary]![Child2].Requery. When the
[quoted text clipped - 12 lines]
> Regards
> Nick