Solved

Calendar Advice

Posted on 2004-09-08
8
418 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
Comment Utility
Guess everyone's gone, be back tomorrow.
0
 
LVL 2

Expert Comment

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

Expert Comment

by:lightcross
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:JordanKingsley
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

771 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

16 Experts available now in Live!

Get 1:1 Help Now