Multiple dates from Access 2003 Calendar Control?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • truthlover
    New Member
    • Dec 2007
    • 107

    Multiple dates from Access 2003 Calendar Control?

    I have a DB that tracks the days a certain person is going to be working on a task and I need to be able to choose multiple dates for the task.

    Is there a way to choose mulitple dates from a calendar control I have in an Access 2003 form?

    The days might not be consecutive (ie Mon, Thu, Fri) but if that's not possible, a date range would be a close second.

    I dont know VB so I kind of need it spelled out for me (sorry)

    The DB went live today, so I need a solution asap.

    Thanks in advance!!
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Your post is not terribly clear, I'm afraid, but I'll attempt to answer it, guessing at what you mean!

    Are you asking if you can use a single Access Calendar control to fill in multiple textboxes on your form, each with a single date?

    Yes. Using the code below, you can fill out any textbox on your form, by first clicking on the textbox, then clicking on the desired date on the calendar. Replace YourCalendar in the code with the actual name of your calendar control.
    Code:
    Private Sub YourCalendar_AfterUpdate()
      Screen.PreviousControl =Your Calendar
    End Sub
    Are you asking if you can click on multiple dates on the calendar and have them fill a single textbox?

    Yes, but in this case you'd have to explicitly use the textbox name. Replace YourDateField with actual name of your textbox.
    Code:
    Private Sub YourCalendar_AfterUpdate()
      Me.YourDateField = Me.YourDateField & " " & YourCalendar
    End Sub
    Note that if the latter guess above is the correct one, the field in your table/query that the textbox is bound to needs to be defined as a Text field, not as a Date field, and that you should only use this combined field to view on the form or to print in a report. If you will ever need to do any kind of manipulation to the data in this field, you need to rethink your strategy and store the dates in individual controls, rather than in a single control!

    Either set of code (minus the line numbers!) needs to go in the VBA code window behind your form.

    If I've guessed incorrectly in both cases, post back with a clearer explanation and we'll try to help you out.

    Welcome to TheScripts!

    Linq ;0)>

    Comment

    • truthlover
      New Member
      • Dec 2007
      • 107

      #3
      Sorry about the imbeguity, but you managed to decipher my question ;)

      Your second guess is what I'm after, but the text box wont work because I need to sort and query by date.

      Isnt there a way to do what Outlook Calendar does when you do a recurring appointment?

      If not, how can I accomplish this? I've been trying to use a separate table, but for some reason, I cant get it to work with my current form without breaking it.

      Thanks!


      Originally posted by missinglinq
      Your post is not terribly clear, I'm afraid, but I'll attempt to answer it, guessing at what you mean!

      Are you asking if you can use a single Access Calendar control to fill in multiple textboxes on your form, each with a single date?

      Yes. Using the code below, you can fill out any textbox on your form, by first clicking on the textbox, then clicking on the desired date on the calendar. Replace YourCalendar in the code with the actual name of your calendar control.
      Code:
      Private Sub YourCalendar_AfterUpdate()
      Screen.PreviousControl =Your Calendar
      End Sub
      Are you asking if you can click on multiple dates on the calendar and have them fill a single textbox?

      Yes, but in this case you'd have to explicitly use the textbox name. Replace YourDateField with actual name of your textbox.
      Code:
      Private Sub YourCalendar_AfterUpdate()
      Me.YourDateField = Me.YourDateField & " " & YourCalendar
      End Sub
      Note that if the latter guess above is the correct one, the field in your table/query that the textbox is bound to needs to be defined as a Text field, not as a Date field, and that you should only use this combined field to view on the form or to print in a report. If you will ever need to do any kind of manipulation to the data in this field, you need to rethink your strategy and store the dates in individual controls, rather than in a single control!

      Either set of code (minus the line numbers!) needs to go in the VBA code window behind your form.

      If I've guessed incorrectly in both cases, post back with a clearer explanation and we'll try to help you out.

      Welcome to TheScripts!

      Linq ;0)>

      Comment

      • truthlover
        New Member
        • Dec 2007
        • 107

        #4
        I managed to get the separate table option to work.

        Thanks!

        Originally posted by truthlover
        Sorry about the imbeguity, but you managed to decipher my question ;)

        Your second guess is what I'm after, but the text box wont work because I need to sort and query by date.

        Isnt there a way to do what Outlook Calendar does when you do a recurring appointment?

        If not, how can I accomplish this? I've been trying to use a separate table, but for some reason, I cant get it to work with my current form without breaking it.

        Thanks!

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          Glad we could help!

          Linq ;0)>

          Comment

          Working...