ActiveX calendars

Robert C

Registered User.
Local time
Today, 16:58
Joined
Mar 27, 2000
Messages
88
I have a form on which I log the realease and return of hired out tools. I have an ActiveX calendar on the form to enable me to enter the ReleaseDate but I would like to use the same calendar to enter the ReturnDate but at present the Control Source for the calendar is only the ReleaseDate. Is there any way in which the calendar can be used to provide dates for both fields or do I have to have two calendars?

Also can you insert an activeX calendar on a tab control - I seem to have trouble doing this.

Many thanks in advance.


[This message has been edited by Robert C (edited 05-22-2000).]
 
are these fields bound or unbound to the calendar?
 
I can think of two options for you. Either way, you have to make sure the calendar is unbound and use VB code to set the data in your fields.

1)You could try adding a toggle switch to the your form which would set the calendar to update the either the Loan Date or the Return date. When the calendar's OnUpdated event ran, based on the value of the toggle, either the Loan date OR the Return date would update. To do this try:

- First, make sure the calendar is UNbound (ie. make sure the Control Source in the properties screen is blank).
- Create Toggle Button; set the Loan date value to 1 and the Return date value to 2.
- In the OnUpated event for the calendar, write the following code (of course tailoring it to your db):

If NameOfToggleSwitch = 1 Then
Me![LoanDate]= Me![NameCalendarControl]
Elseif NameOfToggleSwitch = 2 Then
Me![ReturnDate]= Me![NameCalendarControl]
End If


OR.......

2) Remove the calendar from the main form all together. Next to your date fields, place buttons that will launch a modal, pop-up form with the calendar control. On the Date select form, have a "Done" button or something similar that updates the appropriate field on your main for with the calendar value. The code for that would look like:

Forms![MainFormName] = Me![CalendarControl]
DoCmd.Close acForm, "NameOfDateSelectForm"

I wrote this in kind of a hurry, so if you don't understand something OR if what I suggested didn't work, let me know and I can take another shot at it!

Jamie
 

Users who are viewing this thread

Back
Top Bottom