Calendar

N

nice_evest

I'm inserting the calendar control to the form, make it invisible, link it to
one of the date fields; i need to put a toggle button that when i click on
it, the calendar control appears and become able to select the date i need,
and to be placed in the linked field.
what i did is, i made the calendar invisible, placed a toggle button next to
the field, on the properties, event tab; when clicked, to run a macro; go to
control, my control's name in the argument field. Run the macro... cant be
run, cz the calender is invisible. please advice!!! i need to click the
toggle button that would make me able to view the calendar control and select
the desired date.
i would put a picture for you to know what i mean, but unfortunately, i
couldnt.
 
B

Boni

Use VB to do what you want. Hard to do that in macro. Anyways, set the
calendar button's onclick event with the ff code:

if YourCalendar ActiveX.Visible = False then
YourCalendarActiveX.Visible = True
else
YourCalendarActiveX.Visible = False
end if

Now, to be able to set the date based on the calendar value, create a
dblClick event for YourCalendarActiveX and place the ff code:

DateField = YourCalendarActiveX.Value
DateField.SetFocus
YourCalendarActiveX.Visible = False

You have to Set the focus back to the DateField to be able to set the
Visible property of the ActiveX to False or you'll get an error. The
DateField is the field where you intend to put the date resulting from the
date selection in the calendar. I used dblclick here since the Calendar
ActiveX in access does not have an event to accept the final date.

Hope that helps.
 

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