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

Calendar error

P: n/a
I posted this problem earlier in the month and some one decided it was
better to change the subject and ask a completely different question.
I am therefore reposting. I am hoping some one can assist with this.
Thanks in advance.

I have an access database that i have added a pop up calendar to, the
Table information for the Date Reported field is
Date/Time
format short date,
input mask is 00/00/0000.

i have created a combo box on the form and have bound the control to
the Date Reported field. I have placed the calendar control on the
form and set the Visible property to no.
The following code has bee added to the Mouse Down Event of the Date
Reported combo box.
Private Sub Date_Reported_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
' show calendar and set date
Calendar.Visible = True
Calendar.SetFocus
End Sub
The folowing code has been added to the Click event for the calendar
control.
Private Sub Calendar_Click()
' Set Date reported to selected date and hide calendar
Date_Reported.Value = Calendar.Value
Date_Reported.SetFocus
Calendar.Visible = False
End Sub
When i go back to the form and click on the combo box control i
receive an error stating. "The value you have entered isn't valid for
this field." This is displayed twice before showing the calendar. I
am
able to clcik on a date in the calendar and it si then displayed int
he combo box control.
I am at a loss to fix this.
Please advise.
Thanks
Karl

May 17 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 17 May 2007 00:51:53 -0700, "th****@gmail.com" <th****@gmail.com>
wrote:

I have a hard time following your logic - perhaps that's why you're
not getting many responses.
You have a combobox that you want to put a date in using a calendar
control??? Then you fiddle with the MouseDown event, ignoring the fact
that people can interact with a dropdown using the keyboard only (e.g.
Alt+CurDown)???

DateReported should probably be a textbox, bound to the DateReported
field in the underlying table or query. If you want to help the user
with a calendar control (you don't mention which one - every one is
different), you actually need to know how to write some code to show
that calendar (perhaps in a modal form) and upon selection put the
value in the desired textbox.

One alternative is to use the "Microsoft Date and Time Picker
Control". You can find it in your toolbox under ActiveX controls. No
programming needed, just put it in the place of the DateReported
textbox.

-Tom.

>I posted this problem earlier in the month and some one decided it was
better to change the subject and ask a completely different question.
I am therefore reposting. I am hoping some one can assist with this.
Thanks in advance.

I have an access database that i have added a pop up calendar to, the
Table information for the Date Reported field is
Date/Time
format short date,
input mask is 00/00/0000.

i have created a combo box on the form and have bound the control to
the Date Reported field. I have placed the calendar control on the
form and set the Visible property to no.
The following code has bee added to the Mouse Down Event of the Date
Reported combo box.
Private Sub Date_Reported_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
' show calendar and set date
Calendar.Visible = True
Calendar.SetFocus
End Sub
The folowing code has been added to the Click event for the calendar
control.
Private Sub Calendar_Click()
' Set Date reported to selected date and hide calendar
Date_Reported.Value = Calendar.Value
Date_Reported.SetFocus
Calendar.Visible = False
End Sub
When i go back to the form and click on the combo box control i
receive an error stating. "The value you have entered isn't valid for
this field." This is displayed twice before showing the calendar. I
am
able to clcik on a date in the calendar and it si then displayed int
he combo box control.
I am at a loss to fix this.
Please advise.
Thanks
Karl
May 18 '07 #2

P: n/a
On May 18, 12:31 am, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On 17 May 2007 00:51:53 -0700, "tho...@gmail.com" <tho...@gmail.com>
wrote:

I have a hard time following your logic - perhaps that's why you're
not getting many responses.
You have a combobox that you want to put a date in using a calendar
control??? Then you fiddle with the MouseDown event, ignoring the fact
that people can interact with a dropdown using the keyboard only (e.g.
Alt+CurDown)???

DateReported should probably be a textbox, bound to the DateReported
field in the underlying table or query. If you want to help the user
with a calendar control (you don't mention which one - every one is
different), you actually need to know how to write some code to show
that calendar (perhaps in a modal form) and upon selection put the
value in the desired textbox.

One alternative is to use the "Microsoft Date and Time Picker
Control". You can find it in your toolbox under ActiveX controls. No
programming needed, just put it in the place of the DateReported
textbox.

-Tom.
I posted this problem earlier in the month and some one decided it was
better to change the subject and ask a completely different question.
I am therefore reposting. I am hoping some one can assist with this.
Thanks in advance.
I have an access database that i have added a pop up calendar to, the
Table information for the Date Reported field is
Date/Time
format short date,
input mask is 00/00/0000.
i have created a combo box on the form and have bound the control to
the Date Reported field. I have placed the calendar control on the
form and set the Visible property to no.
The following code has bee added to the Mouse Down Event of the Date
Reported combo box.
Private Sub Date_Reported_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
' show calendar and set date
Calendar.Visible = True
Calendar.SetFocus
End Sub
The folowing code has been added to the Click event for the calendar
control.
Private Sub Calendar_Click()
' Set Date reported to selected date and hide calendar
Date_Reported.Value = Calendar.Value
Date_Reported.SetFocus
Calendar.Visible = False
End Sub
When i go back to the form and click on the combo box control i
receive an error stating. "The value you have entered isn't valid for
this field." This is displayed twice before showing the calendar. I
am
able to clcik on a date in the calendar and it si then displayed int
he combo box control.
I am at a loss to fix this.
Please advise.
Thanks
Karl- Hide quoted text -

- Show quoted text -
Thanks for the reply.

What i am trying to do is had a popup calendar appear when the date
control on a form is selected, then once a date is selected show that
date in the date field and close the calendar.

I have tried a few different ways i am am able to get the calendar to
appear and insert the selected date, then close the calendar. However
i recieve an error indicating that the value for the field is not
valid. when i click okay it closes the error message and everything is
okay.

May 21 '07 #3

P: n/a
On May 21, 4:01 pm, "tho...@gmail.com" <tho...@gmail.comwrote:
On May 18, 12:31 am, Tom van Stiphout <no.spam.tom7...@cox.netwrote:


On 17 May 2007 00:51:53 -0700, "tho...@gmail.com" <tho...@gmail.com>
wrote:
I have a hard time following your logic - perhaps that's why you're
not getting many responses.
You have a combobox that you want to put a date in using acalendar
control??? Then you fiddle with the MouseDown event, ignoring the fact
that people can interact with a dropdown using the keyboard only (e.g.
Alt+CurDown)???
DateReported should probably be a textbox, bound to the DateReported
field in the underlying table or query. If you want to help the user
with acalendarcontrol (you don't mention which one - every one is
different), you actually need to know how to write some code to show
thatcalendar(perhaps in a modal form) and upon selection put the
value in the desired textbox.
One alternative is to use the "Microsoft Date and Time Picker
Control". You can find it in your toolbox under ActiveX controls. No
programming needed, just put it in the place of the DateReported
textbox.
-Tom.
>I posted this problem earlier in the month and some one decided it was
>better to change the subject and ask a completely different question.
>I am therefore reposting. I am hoping some one can assist with this.
>Thanks in advance.
>I have an access database that i have added a pop upcalendarto, the
>Table information for the Date Reported field is
>Date/Time
>format short date,
>input mask is 00/00/0000.
>i have created a combo box on the form and have bound the control to
>the Date Reported field. I have placed thecalendarcontrol on the
>form and set the Visible property to no.
The following code has bee added to the Mouse Down Event of the Date
>Reported combo box.
>Private Sub Date_Reported_MouseDown(Button As Integer, Shift As
>Integer, X As Single, Y As Single)
>' showcalendarand set date
>Calendar.Visible = True
>Calendar.SetFocus
>End Sub
>The folowing code has been added to the Click event for thecalendar
>control.
>Private Sub Calendar_Click()
>' Set Date reported to selected date and hidecalendar
>Date_Reported.Value =Calendar.Value
>Date_Reported.SetFocus
>Calendar.Visible = False
>End Sub
>When i go back to the form and click on the combo box control i
>receive an error stating. "The value you have entered isn't valid for
>this field." This is displayed twice before showing thecalendar. I
>am
>able to clcik on a date in thecalendarand it si then displayed int
>he combo box control.
>I am at a loss to fix this.
>Please advise.
>Thanks
>Karl- Hide quoted text -
- Show quoted text -

Thanks for the reply.

What i am trying to do is had a popupcalendarappear when the date
control on a form is selected, then once a date is selected show that
date in the date field and close thecalendar.

I have tried a few different ways i am am able to get thecalendarto
appear and insert the selected date, then close thecalendar. However
i recieve an error indicating that the value for the field is not
valid. when i click okay it closes the error message and everything is
okay.- Hide quoted text -

- Show quoted text -
I revisited my database and have been able to input a popup calendar
without the errors.

Thanks Karl

May 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.