Results 1 to 12 of 12
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calendar Function

    In Office 97, I want to enable a user (on a form) to click on a graphic calendar and have the date selected entered into a field called date selected. I am able to create the table etc and the calendar (Calendar Control 8.0 in the form design grid) but am struggling to link the two.

    Can any one help?

    Thanks...Peter

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    The Calender control does have a ControlSource property.
    If your form is bound, you can bind the Calender control to a date field in your table using that property.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    I found this great example of a calendar control that I feel is much better and easier to use than the MS Calnedar control. It was originally written in VB and it's been converted to Access. I've used it successfully for many different applications.

    Just import the basCalendar module and the frmCalendar form to your database. Create a command button to launch the calendar with the control source of:
    =PopupCalendar([MyDateFieldName])

    By the way, this sample database also demonstrates the use of several different popups, including a calculator and an alternative Zoom box. I didn't create it, and I honestly forgot where I found it, but it's been a lifesaver! Enjoy!

    HTH
    Attached Files Attached Files

  4. #4
    Star Lounger
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Thank you for the (quick)feedback. I will have a look at this in the next day or so.

    Regards....Peter

  5. #5
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Hi MarkJ
    I,ve downloaded the brilliant calendar db you recommended to another lounger. I've managed to get the popup working when I select my date box on a form but when I select a date from the calendar, an apparently random date is placed in the box. When I try again, the calendar pops up at the last date and, after selecting a required date, the wrong date is input. At least the year is correct but month and day is not. Any suggestions? Many thanks for your time.

    Rob
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Hi Rob,

    I take it you're using a Textbox for the date input... It also sounds like you're using the OnEnter or OnGotFocus event of the Textbox to open the popup...

    One thing you might want to check is the control name of the TextBox control. If it's the same as the field name, the "random" date you're seeing could possibly be the field's default value. Try changing the name of the control to anything else - such as txtStartDate. Then, of course, update the command for opening the popup - =PopupCalendar([txtStartDate])

    I've never had any odd behavior from this popup, so I'm curious to find out what's causing it. Please post back with any updates (positive or negative).

    Thanks,

  7. #7
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Hi MarkJ
    Many thanks for the quick response. I eventually sorted out my problem. My date field in my appointments table is formatted for British dates (dd,mm,yy) whilst the calendar assumes American dates. I simply changed the calendar code from "mm,dd,yy" to "dd,mm,yy" and everything works perfectly. The pop up certainly adds a touch of class to the form and I can see that it will be so useful for other projects. Have you any other little gems? Again many thanks.

    Rob
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Rob,

    I'm glad you were able to find the problem. I'm also glad to know that the date format can cause this issue.

    I created a custom splash screen form that I use in almost every Access application that I build. I had to remove the graphics to make it small enough to post here, but the functionality is still present. See <post#=51710>post 51710</post#>.

    Hope this helps!

    Best,

  9. #9
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Hi MarkJ
    Many thanks for your previous help and the useful splash screen. However another problem has emerged with the calendar control. I have used it successfuly over the weekend at home but, after downloading it today for use in my school, on double-clicking the date text box to call up the popup, I get an error message. This reads "Compile error: Can't find project or library" and the offending code is presented. The Date argument is highlighted of the IIf function and is supposedly not recognized in the definitions. The same applies to the other popups. Any ideas?
    Regards
    Rob
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  10. #10
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Hi Rob, this issue is not directly related to the calendar control. I'm not sure exactly what causes it, but I can offer a few suggestions:
    1) Open a VBA Window, check Tools | References... for any items marked as Missing (They'll be near the top of the list). Uncheck the Missing items then compile the database again.
    2) Double check to make sure you're using latest approved Service Pack (SP2 for 97, SP1a for 2000, SP1 for 2002).

    If that doesn't help, try searching on the Access forum for project library. There have been some fruitful discussions of this same issue in the past.

    Hope this helps

  11. #11
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Hi Mark
    Your first suggestion on the list worked a treat. I wish all problems were so easily solved.
    Again, many thanks for your help and time.
    Rob
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  12. #12
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Function

    Hi
    I've had plenty of success with Date&Time Picker and it looks very sleak.
    Mines in A2000 though, if you can use it in A97, it may be worth you looking at.
    Regards
    Dave.

    p.s I noticed you're from Stafford, just down the road (A50) small world isn't it.

Posting Permissions

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