Solved

Calendars with subforms

Posted on 2002-03-13
4
472 Views
Last Modified: 2010-05-18
Hi

I'm using MSAccess 97.

I have a form which contains a subform that shows lists of appointments made. I want a calendar on my form that when a date is picked the subform will display all the appointments for that date.

Please help!
0
Comment
Question by:vlovato
[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
  • 2
  • 2
4 Comments
 

Expert Comment

by:mad3654
ID: 6861945
vlovato,

create a Module named "bascalendar"
Enter the following lines

Option Compare Database
Option Explicit

Const adhcCalendarForm = "frmCalendar"
---------------------------------------------------------
Function adhDoCalendar(Optional varPassedDate As Variant) As Variant
   
       
    ' From Access 97 Developer's Handbook
    ' by Litwin, Getz, and Gilbert (Sybex)
    ' Copyright 1997.  All rights reserved.
    '
    Dim varStartDate As Variant


    varStartDate = IIf(IsMissing(varPassedDate), _
    Date, varPassedDate)

    If Not IsDate(varStartDate) Then varStartDate = Date
   DoCmd.OpenForm FormName:=adhcCalendarForm, _
   WindowMode:=acDialog, OpenArgs:=varStartDate
     If isOpen(adhcCalendarForm) Then
        adhDoCalendar = Forms(adhcCalendarForm).Value
        DoCmd.Close acForm, adhcCalendarForm
    Else
        adhDoCalendar = Null
    End If
End Function
---------------------------------------------------------
Put an unbound TxtBox and name it "Date" in the form and make the child link and master link of the subform to the txtbox(Date).
Child Link = date
Master Link = date

I put a button on the form with the following code at the On_Click properties

Private Sub Button_Click()
Me!Date = adhDoCalendar((Me!Date))
End Function

I have a canendar form named "frmcalendar"
When you click the button it opens the form "frmcalendar".
When you click on a date, it updates the "Date" txtbox that is linked to the subform.  This should show you the list of Appts for that date.

Hope this helps
You can try adding an Activex control in the form using the same idea. You won't need the modual.

mad
P.s. I can e-mail this sample data base to you if you wish.


0
 

Author Comment

by:vlovato
ID: 6863853
Thanks mad!
Would be grateful if you would email the db to me. Am feeling confused!
(v_lovato@hotmail.com)
V
0
 

Author Comment

by:vlovato
ID: 6863854
Thanks mad!
Would be grateful if you would email the db to me. Am feeling confused!
(v_lovato@hotmail.com)
V
0
 

Accepted Solution

by:
mad3654 earned 100 total points
ID: 6879823
vlovato,
Check out this question if you would like to put the calendar as a subform.


nic5038

http://www.experts-exchange.com/msaccess/Q.20278347.html
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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 …
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…
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…

726 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