Calendar on Form

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

Guest

how can I add a Calendar to a form so it doesn't view unless pushed by a button or some other way?
 
Add a button to the form and put

me.calendarname.visible = true

in the on click event
-----Original Message-----
how can I add a Calendar to a form so it doesn't view
unless pushed by a button or some other way?
 
Bobby said:
how can I add a Calendar to a form so it doesn't view unless pushed by a button or some other way?

Bobby,
I have an example AC2000 DB at http://www.byerley.net/AccessCalDemo.zip . The calendar is on its own
form and therefore the single calendar can be used on many forms in your app.. There is example code
showing how to implement it on each type of form including datasheet view and subforms.
 
See:
http://www.lebans.com/monthcalendar.htm
A97MonthCalendar.zip is an A97 database containing a Class that wraps
the Microsoft Month Calendar Common Control in an easy to use interface.
A2K Version here: MonthCalendar Access 2000.zip
This is a completely API generated Month Calendar derived directly from
the Common Control DLL. What this means is that there are no
distribution or versioning issues as there are if you use the ActiveX
Month Calendar control. In other words this is not an ActiveX control!

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Bobby said:
how can I add a Calendar to a form so it doesn't view unless pushed by
a button or some other way?
 
Mike... your method 1 is exactly what I am looking for.. i have copied your code in, however I am still not able to get the calendar to come up either by double clicking or by pushing the button. I have put the code in the proper places under the Double Click (Field) and OnClick (button) I have tried to structure my names exactly like yours as well, but when I click on the button nothing happens.... any ideas?
 
Bobby said:
Mike... your method 1 is exactly what I am looking for.. i have copied your code in, however I am still
not able to get the calendar to come up either by double clicking or by pushing the button. I have put
the code in the proper places under the Double Click (Field) and OnClick (button) I have tried to
structure my names exactly like yours as well, but when I click on the button nothing happens.... any
ideas?

Did you import the Calendar form "frmCalendar" from the example database into your own database?
 
I used Mike B's code and was able to get it to work on the double click of the field and a click of a button. now I have two date fields on the same screen... i created calendar and calendar1 for the two calendars (because I wanted to tie it into the source data)... I have the two buttons as well. here is my documentation. My issue is it pulls up the calendar for all four situations .. what code change do I need to get the first date/button (which is fine) to pull one calendar.. and the second date/button to pull the second calendar. I am using ActiveX controls....

thanks, Bobb

Private Sub ActivateCalendarForm(ByVal sCtrl As String
Dim sArgs As Strin
Dim sFullFormName As Strin
If IsSubForm(Me) = True The
sFullFormName = "SubForm" & "*" & Me.Parent.Nam
Els
sFullFormName = "Form" & "*" & Me.Nam
End I
sArgs = sFullFormName & "|" & sCtr
If IsObject(Command74) = True The
DoCmd.OpenForm "frmCalendar", , , , acFormPropertySettings, acDialog, sArg
Els
If IsObject(DateRaised) = True The
DoCmd.OpenForm "frmCalendar", , , , acFormPropertySettings, acDialog, sArg
Els
DoCmd.OpenForm "frmCalendar1", , , , acFormPropertySettings, acDialog, sArg
End I
End I

End Su

Private Function IsSubForm(fForm As Form) As Boolea
On Error GoTo HandleEr
If IsObject(fForm.Parent) The
IsSubForm = True 'The Form Passed is a Subfor
Els
IsSubForm = False 'The Form Passed is a Mainfor
End I

Exit Functio
HandleErr
IsSubForm = Fals
End Functio

Private Sub Command74_Click(
ActivateCalendarForm "DateRaised
End Su
Private Sub DateRaised_DblClick(Cancel As Integer
ActivateCalendarForm "FrmCalendar
End Su

Private Sub Text1_DblClick(Cancel As Integer
ActivateCalendarForm "Text1
End Su
Private Sub Command76_Click(
ActivateCalendarForm "DateCleared
End Su
Private Sub DateCleared_DblClick(Cancel As Integer
ActivateCalendarForm "FrmCalendar1
End Su
Private Sub Text2_DblClick(Cancel As Integer
ActivateCalendarForm "Text2
End Su
 
Back
Top