Solved

Calendar Advice

Posted on 2004-09-08
8
428 Views
Last Modified: 2008-02-01
Hello all. I've recently seen the calendar feature that they have in "Outlook Web Access" and would like to know if there is an add in just like that anywhere that I can incorporate into an Access application. It looks something like a doctor or dentists software. Does anyone know? Thanks, Jordan.
0
Comment
Question by:JordanKingsley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 

Author Comment

by:JordanKingsley
ID: 12012035
Guess everyone's gone, be back tomorrow.
0
 
LVL 2

Expert Comment

by:lightcross
ID: 12012036
There are several options.
You can use an active x control called "date and time picker".
0
 
LVL 2

Expert Comment

by:lightcross
ID: 12012069
I also use a form called "frmPopUpCal" along with a module that seems to be better.  In this message I included the module code and the form code underneath.  Of course you will still need the calendar form that I can email.  I cannot recall exactly where I got this code from but I think it was from a book called " Access Cookbook"
here is the module:

Option Compare Database
Option Explicit

Private Function IsOpen(strForm As String)
    IsOpen = (SysCmd(acSysCmdGetObjectState, acForm, strForm) > 0)
End Function

Public Function acbGetDate(varDate As Variant) As Variant

    Const acbcCalForm = "frmPopupCal"
   
    ' Open calendar form in dialog mode
    ' passing it the current date using OpenArgs
    DoCmd.OpenForm acbcCalForm, WindowMode:=acDialog, _
     OpenArgs:=Nz(varDate)
   
    ' Check if the form is open; if so return the date
    ' selected in the calendar control and close the
    ' popup calendar form and pass the new date back
    ' to the control. Otherwise, just return a null.
    If IsOpen(acbcCalForm) Then
        acbGetDate = Forms(acbcCalForm).CalDate
        DoCmd.CLOSE acForm, acbcCalForm
    Else
        acbGetDate = Null
    End If
End Function

'the form code looks like this:
Option Compare Database
Option Explicit

Public Property Let CalDate(datDate As Date)
    Me!ocxCal = datDate
End Property

Public Property Get CalDate() As Date
    CalDate = Me!ocxCal
End Property

Private Sub cmdCancel_Click()
    DoCmd.CLOSE acForm, Me.Name
End Sub

Private Sub cmdNextMonth_Click()
    Me!ocxCal.NextMonth
    Me.Repaint
End Sub

Private Sub cmdNextYear_Click()
    Me!ocxCal.NextYear
    Me.Repaint
End Sub

Private Sub cmdOK_Click()
    Me.Visible = False
End Sub

Private Sub cmdPrevMonth_Click()
    Me!ocxCal.PreviousMonth
    Me.Repaint
End Sub

Private Sub cmdPrevYear_Click()
    Me!ocxCal.PreviousYear
    Me.Repaint
End Sub

Private Sub cmdToday_Click()
    Me!ocxCal.Today
End Sub

Private Sub Form_Load()
    Me!ocxCal.Today
    If Not IsNull(Me.OpenArgs) Then
        Me.CalDate = Me.OpenArgs
    End If
End Sub

Private Sub ocxCal_DblClick()
    Call cmdOK_Click
End Sub


0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 2

Expert Comment

by:lightcross
ID: 12012105
On the form you wish to use the calendar you will place this code on a command button.  You will need to have a textbox named "tbDateSubmitted" or change that line of code to match your date textbox(es).

Private Sub cmdDateSubmit_Click()

    Dim ctlDate As TextBox
    Dim varReturn As Variant
   
    '[control name]
    Set ctlDate = Me![tbDateSubmitted]
   
    ' Request date
    varReturn = acbGetDate(ctlDate.value)
   
    ' Only change the value if null is not
    ' returned; otherwise user cancelled
    ' so preserve existing value.
    If Not IsNull(varReturn) Then
        ctlDate = varReturn
    End If
       
End Sub
0
 

Author Comment

by:JordanKingsley
ID: 12018487
Wow lightcross, that looks exactly like what I'm looking for, could you email me the form to "grijordan@sunflower.com", thanks so much.
0
 
LVL 2

Expert Comment

by:lightcross
ID: 12019128
I emailed you a database with form, code, and module you will need to get your calendar up and running.  In case you havent noticed, I usually lock the date textbox so that users must use the calendar command button to enter the date.
0
 

Author Comment

by:JordanKingsley
ID: 12019342
Thanks so much lightcross. The email came but this machine is acting really fishy. After a complete scan I'll open the mdb file and get it running. Can you check back in here in a couple of hours? Thanks again :)
0
 
LVL 2

Accepted Solution

by:
lightcross earned 400 total points
ID: 12019370
sure, it emails me when ever you post.  so i will check back incase you need additional help.  You may need to add references.  Check the vba references within the sample I sent you and add them just to be on the safe side.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question