Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Calendar Object

Status
Not open for further replies.

junaid

Programmer
Apr 5, 2002
3
0
0
US
Hi
I have a form in which there is a date field, i have a
calendar displyed on the form.
I want to use calendar object to enter the data in that date field.
how can it be done.
please advise.

Thanks
 
Dear junaid,

Try this on_exit procedure from the Calendar:

Code:
Private Sub ocxCalendar_Exit(Cancel As Integer)
    Forms!YourForm!YourDateField = Me.ocxCalendar
    
End Sub

I got this from a Calendar developed by Joe Miller, joemiiier@aol.com
Thank him.
You can find where he has the download somewhere on this site using the Search facility
and entering 'Calendar'

Regards Jim
 
Input this code on the form where the cal.control and the date field are. This will populate the Datefield with the CalControlName value when you double click on a date on the calender control. Give it a shot.


Private Sub CalControlName_DblClick()
Dim actcontrol As Object
Set actcontrol = Datefield
actcontrol.SetFocus
actcontrol = calcontrolname.Value
End Sub

Phil
 
Goto the VBA window for your calendar control. I assume you are using the ActiveX calendar control.

Private Sub calctrl_AfterUpdate()
Forms!YourForm!YourDate = "#" & ME![calctrl] & "#"
End Sub

When you click on a new date, or use the calendar controls, this will update the other control.
 
Hi,

I don't kow if this apllies to your questions, but: if I use a calender control in access 97, it does not work with an unbound control on a form. To be more specific: when I want to use the calender control to specify a date range for a report, it just does not work.

Suggestions are welcome
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top