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

Calendar Control Questions

P: n/a
I have a form with (among other controls) three text boxes that hold
date fields from the underlying ControlSource. I have the OnDoubleClick
event for each set to open up a Modal Popup form that has an axCalendar
control. I have two buttons on the form as well, PostDate and Close.
PostDate successfully populates the double clicked field with the date
of the axCalendar. Close closes the Modal Popup form.

1) How do I get the Modal Popup form to open with the axCaledar set to
the current date? I have tried me.axCalName = Date in the OnActivate
and on the onOpen events with no luck.

2) How do I make the PostDate button also close the form? When I try to
add the docmd.close in the PostDate sub, I get an 2585 error message
"This action cannot be carried out while processing a form or report
event".

Thanks...
Feb 6 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mon, 5 Feb 2007 22:56:29 -0500, Swans, What Swans?
<fz@barkingpumpkin.ooowrote:

Write your code in a central function, rather than duplicating it for
each doubleclick event.
In that function you can pass the date of the control to your modal
form using the OpenArgs argument of DoCmd.OpenForm.
When you want to close the form upon button click, don't close it but
set Me.Visible=False. That will make it fall out of the modal loop,
your function gets control back, you can inspect the form to see which
date was selected and then close it. Finally you set the chosen value
to the control called from (which may well have been passed into the
central function).

-Tom.

>I have a form with (among other controls) three text boxes that hold
date fields from the underlying ControlSource. I have the OnDoubleClick
event for each set to open up a Modal Popup form that has an axCalendar
control. I have two buttons on the form as well, PostDate and Close.
PostDate successfully populates the double clicked field with the date
of the axCalendar. Close closes the Modal Popup form.

1) How do I get the Modal Popup form to open with the axCaledar set to
the current date? I have tried me.axCalName = Date in the OnActivate
and on the onOpen events with no luck.

2) How do I make the PostDate button also close the form? When I try to
add the docmd.close in the PostDate sub, I get an 2585 error message
"This action cannot be carried out while processing a form or report
event".

Thanks...
Feb 6 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.