• Calendar Function

    Author
    Topic
    #352974

    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

    Viewing 1 reply thread
    Author
    Replies
    • #514913

      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.

    • #514937

      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

      • #515206

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

        Regards….Peter

      • #622069

        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

        • #622076

          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,

          • #622093

            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

            • #622099

              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.

              Hope this helps!

              Best,

            • #622344

              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

            • #622357

              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

            • #623003

              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

            • #623487

              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.

    Viewing 1 reply thread
    Reply To: Calendar Function

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: