Calendar

mlamont

Registered User.
Local time
Today, 11:50
Joined
Jun 25, 2001
Messages
45
Hi,

I was wondering if somebody could tell me if the following is possible, and if so how I could set it up.

I would like to be able to click on a button and a small calendar would appear, after selecting a date on the small calendar I would like the date to appear in a text box.

Cheers,

Mike
 
Download the Developer Solutions smpl from the MS Download site, there's an example in it to help you
 
Location

Can you give the the URL for the MS download site?
 
have you got the Access 97 developers book? i used the disk on that and got one! OR im not sure but this might work
put
Option Compare Database 'Use database order for string comparisons
Option Explicit

' From Access 97 Developer's Handbook
' by Litwin, Getz, and Gilbert (Sybex)
' Copyright 1997. All rights reserved.

Const adhcCalendarForm = "frmCalendar1"

Function adhDoCalendar1(Optional varPassedDate As Variant) As Variant
'
' This is the public entry point.
' If the passed in date is missing (as it will
' be if someone just opens the Calendar form
' raw), start on the current day.
' Otherwise, start with the date that is passed in.

' From Access 97 Developer's Handbook
' by Litwin, Getz, and Gilbert (Sybex)
' Copyright 1997. All rights reserved.
'
Dim varStartDate As Variant

' If they passed a value at all, attempt to
' use it as the start date.
varStartDate = IIf(IsMissing(varPassedDate), _
Date, varPassedDate)
' OK, so they passed a value that wasn't a date.
' Just use today's date in that case, too.
If Not IsDate(varStartDate) Then varStartDate = Date
DoCmd.OpenForm FormName:=adhcCalendarForm, _
WindowMode:=acDialog, OpenArgs:=varStartDate

' You won't get here until the form is
' closed or hidden.
'
' If the form is still loaded, then get the
' final chosen date from the form. If it isn't,
' return Null.
If isOpen(adhcCalendarForm) Then
adhDoCalendar1 = Forms(adhcCalendarForm).Value
DoCmd.Close acForm, adhcCalendarForm
Else
adhDoCalendar1 = Null
End If
End Function

Private Function isOpen(strName As String, _
Optional intObjectType As Integer = acForm)
' Returns True if strName is open, False otherwise.
' Assume the caller wants to know about a form.
isOpen = (SysCmd(acSysCmdGetObjectState, _
intObjectType, strName) <> 0)
End Function

into Modules call it basCalendar
then you need the form
 

Users who are viewing this thread

Back
Top Bottom