Results 1 to 5 of 5

Thread: Access Calendar

  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Unanswered: Access Calendar

    I have read through the post about Calendar Control, but did not find exactly what I was looking for.

    I want to put a Calendar on a form and when you click on a date, any and all data records associated with that date appears in a sub-form.

    Any help would be appreciated.

  2. #2
    Join Date
    Jan 2004
    Location
    Texas
    Posts
    1

    Re: Access Calendar

    Originally posted by terryspicer
    I have read through the post about Calendar Control, but did not find exactly what I was looking for.

    I want to put a Calendar on a form and when you click on a date, any and all data records associated with that date appears in a sub-form.

    Any help would be appreciated.

    I'm trying to do the Same thing with an appointment scheduling dB but I can't seem to find anything either.

    I've had some success trying to do this with a query but I can only get it to display the current dates data in a subform - I'm still trying to figure it out. If I do I'll make sure to let you know - likewise - if you get it figured out I would appreciate a heads up.

    J.

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    Code:
    [FORMS]![mySubForm].RowSource = "SELECT * FROM myTableName WHERE [myTableDateField] = '" & Me.Calendar1.Value & "';"
    or something like that...

    You may need to use the Format function to make the Me.Calendar1.Value match what is in table:
    Code:
    Format(Me.Calendar1.Value, "Medium Date")
    or place the Me.Calendar1.Value into a variable - i.e.:
    Code:
    Dim MyDate As Date
    MyDate = Me.Calendar1.Value
    then your SQL would look like:

    Code:
    "SELECT * FROM myTableName WHERE [myTableDateField] = '" & MyDate & "';"
    
    OR
    
    "SELECT * FROM myTableName WHERE [myTableDateField] = " & MyDate & ";"
    Hope this sheds a little bit of light

  4. #4
    Join Date
    Jan 2004
    Posts
    1
    If your field is stored as a date you'll need to jimmy the SQL a little to include the # rather than the " (used for strings)

    "SELECT * FROM myTableName WHERE [myTableDateField] = #" & MyDate & "#;"

    OR

    "SELECT * FROM myTableName WHERE [myTableDateField] = #" & MyDate & "#;"

    Flav's

  5. #5
    Join Date
    Jul 2002
    Location
    Romania
    Posts
    122
    LinkChildFields property of the subform: NameOfDateField from subform recordsource
    LinkMasterFields: name of your Calendar control.

    HTH

    Dan
    Daniel Vlas

    Access Addict

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •