Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pick a date (Access 97)

    On a form created in Access97, I have included the ActiveX control that allows you to pick a date from a calendar. Would appreciate any assistance on the following: I want to be able to click on a button and have the result obtained with the ActiveX control inserted into a date field in the same form. Thanks in advance!

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pick a date (Access 97)

    First, name the calendar control to something that looks good. (You don't want the neighbors talking.) How about CalControl?

    CalControl has a property named Value that is changed everytime that darned left
    mouse button is clicked over one of those day buttons on the calendar. You
    reference that value by using this complicated formula:

    CalControl.Value

    Now, just assign that value to your date variable (let's say you named it MyDate):

    MyDate = CalControl.Value

    Experiment by putting this code on the form under Build Event:

    <pre>Private Sub CalControl_Click()
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pick a date (Access 97)

    Thank, Kevin! The complicated code you provided worked like a charm!

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Location
    Upstate NY, New York, USA
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pick a date (Access 97)

    Hi Kevin...

    I found this thread and it has been helpful to me since I've never used the calendar control before this. Now, you know I'm a novice and this may be a really dumb question but I have to ask it. When I created the user form with the calendar control, the control properties for the date are set to 8/17/2001. Will this change to reflect the current date when used by the end users? If not, how do I have it increment day by day?

    Thanks Kev.

Posting Permissions

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