By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,735 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

Multiple dates from Access 2003 Calendar Control?

truthlover
100+
P: 107
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!!
Feb 25 '08 #1
Share this Question
Share on Google+
4 Replies


missinglinq
Expert 2.5K+
P: 3,532
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.
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCalendar_AfterUpdate()
  2.   Screen.PreviousControl =Your Calendar
  3. 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.
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCalendar_AfterUpdate()
  2.   Me.YourDateField = Me.YourDateField & " " & YourCalendar
  3. 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)>
Feb 25 '08 #2

truthlover
100+
P: 107
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!


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.
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCalendar_AfterUpdate()
  2. Screen.PreviousControl =Your Calendar
  3. 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.
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCalendar_AfterUpdate()
  2. Me.YourDateField = Me.YourDateField & " " & YourCalendar
  3. 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)>
Feb 25 '08 #3

truthlover
100+
P: 107
I managed to get the separate table option to work.

Thanks!

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!
Feb 26 '08 #4

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Feb 27 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.