Calendar Control Active X 10 problem

D

DubboPete

Hi all

I have scoured the newsgroup's past postings for an answer, but to no avail.

I have a form "Form1" with text boxes "Text0" and "Text 2"
When the form opens, so does a form "Calendar" with Calendar Control
"Calendar3"
[yes, we are in development mode, and I hope to apply it to the relevant
form when someone helps me work it out!]

I want to populate Form1.Text0 with the date that is clicked on the
Calendar3 control.

The calendar control only has the following events.
On Updated
On Enter
On Exit
On Got Focus
On Lost Focus

and not an AfterUpdate event

Could some kind soul please tell me where to put the code, and what exactly
the code should be?

TIA

DubboPete
 
K

Kerry Miller

Select Calendar3 and open the code editor. Near the top will be two drop
down lists. Click the arrow of the one on the right and you will find the
Click event. Simply add:

Private Sub Calendar3_Click()
Form1.Text0 = Calendar3.Value
End Sub

Not sure why you need AfterUpdate, but it's there also.

HTH,
Kerry
 
D

DubboPete

sorry, forgot to mention...
WinXP and Access XP
all service packs updated regularly

DubboPete
 
D

DubboPete

Hi Kerry,

Thanks, I found the event 'click', and added the code... however when
clicking the calendar control the code produces Run-time error '424' -
object required

any clues?
tia
DubboPete
 
K

Kerry Miller

Hi DubboPete,

I can't really research this at the moment but try:

Me.Text0 = Calendar3.Value

Kerry

DubboPete said:
sorry, forgot to mention...
WinXP and Access XP
all service packs updated regularly

DubboPete

DubboPete said:
Hi all

I have scoured the newsgroup's past postings for an answer, but to no avail.

I have a form "Form1" with text boxes "Text0" and "Text 2"
When the form opens, so does a form "Calendar" with Calendar Control
"Calendar3"
[yes, we are in development mode, and I hope to apply it to the relevant
form when someone helps me work it out!]

I want to populate Form1.Text0 with the date that is clicked on the
Calendar3 control.

The calendar control only has the following events.
On Updated
On Enter
On Exit
On Got Focus
On Lost Focus

and not an AfterUpdate event

Could some kind soul please tell me where to put the code, and what exactly
the code should be?

TIA

DubboPete
 
D

DubboPete

Thanks all for your help, now got it working great, and implemented in users
db!

DubboPierre
 

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