Solved

Calendar Advice

Posted on 2004-09-08
8
419 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
  • 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
 
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now