Help! Coding a calendar

A

atech

Hello everyone,

I need help on coding a calendar, here's my situation.

I got this calendar code from 'fontstuff.com
(http://www.fontstuff.com) you can download the sample 'here
(http://www.fontstuff.com/downloads/CalendarDemo2000.mdb).

as you can see it haves to samples

1.) is single calendar demo
the
2.) is a multi calendar demo

I want to work with the multi calendar demo

lets say i have to forms

form1 has a combobox named availabledate
and
form2 has a calendar control

What i want is when you click on the combo box in form 1 it will ope
up form 2 which is where the calendar control is, and when you select
date on form 2 it will transfer the date you picked to form 1 in th
combobox named availabledate.

below is the code i am working with in the multi calendar demo
Option Compare Database
Option Explicit
Dim cboOriginator As ComboBox

Private Sub cboStartDate_MouseDown(Button As Integer, Shift A
Integer, X As Single, Y As Single)
' Note which combo box called the calendar
Set cboOriginator = cboStartDate
' Unhide the calendar and give it the focus
ocxCalendar.Visible = True
ocxCalendar.SetFocus
' Match calendar date to existing date if present or today's date
If Not IsNull(cboOriginator) Then
ocxCalendar.Value = cboOriginator.Value
Else
ocxCalendar.Value = Date
End If
End Sub

Private Sub cboEndDate_MouseDown(Button As Integer, Shift As Integer
X As Single, Y As Single)
' Note which combo box called the calendar
Set cboOriginator = cboEndDate
' Unhide the calendar and give it the focus
ocxCalendar.Visible = True
ocxCalendar.SetFocus
' Match calendar date to existing date if present or today's date
If Not IsNull(cboOriginator) Then
ocxCalendar.Value = cboOriginator.Value
Else
ocxCalendar.Value = Date
End If
End Sub

Private Sub ocxCalendar_Click()
' Copy chosen date from calendar to originating combo box
cboOriginator.Value = ocxCalendar.Value
' Return the focus to the combo box and hide the calendar and
cboOriginator.SetFocus
ocxCalendar.Visible = False
' Empty the variable
Set cboOriginator = Nothing
End Sub

i hope i explained myself right.

Thank You Very Muc
 

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