Calendar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to display the calendar and accept date in a form field, the same
field should also have the option of directly entering the date.

Is it doable, if yes, then can somone please point me to the documentation
or give me a hint to move forward.

Thank you,
-Me
 
you could use double click event to set by calander & single click to set
date manualy :


sub mytextbox double_click
mytextbox = mycalender
end sub
 
Hi Jethro,

Thanks for the reply!

However, per you suggestion
mytextbox = mycalender
what is mycalendar? I don't have any such predefined function.
You may have seen while booking airline tickets on web, for date it displays
the
calendar, I would like to bring up similar calendar. Is there a pre-built
function in
Access? If not, then is it possible to define one then how to?

Thank you very much for your time!
-Me
 
this is where 'mytextbox' is the name of your textbox, and 'mycalander' is
the name of your calander (whatever you called it)
 
Create a popup form named PFrmCalendar and install the calendar control
named MyCalendar. Put the following code in the open event of the popup
form:
Me!MyCalendar.Value = Date()
Put the following code in the AfterUpdate event of the calendar control:
Me.Visible = False

Your form field should be a textbox named MyDate. Add a button next to the
textbox and put the following code in the Click event of the button:
DoCmd.OpenForm "PFrmCalendar",,,,,acDialog
If SysCmd(acSysCmdGetObjectState, acForm, "PFrmCalendar") <> 0 Then
Me!MyDate = Forms!PFrmCalendar!MyCalendar.Value
DoCmd.Close acForm, "PFrmCalendar"
End If
 
Back
Top