A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Popup Calendar



 
 
Thread Tools Display Modes
  #1  
Old November 4th, 2005, 04:43 PM
shep
external usenet poster
 
Posts: n/a
Default Popup Calendar

Using MS Office 2003 Pro
I am trying to add a popup calendar to a subform to enable users to select
date vice typing it in a date field. I have done this on several forms, but
cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't
move the focus to the control DateCalendar " Here is code that works on forms:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

Is there a way to get this to work on the subform?

Thanks
  #2  
Old November 4th, 2005, 06:40 PM
'69 Camaro
external usenet poster
 
Posts: n/a
Default Popup Calendar

Hi, Shep.

If the TransactionDate text box resides on the main form and the
DateCalendar calendar control resides on the subform, then find out the name
of the subform control. This is _not_ the name of the subform, unless you've
made the mistake of naming them the same. Whenever the main form is open,
the subform _doesn't_ exist. It's being "held" by a special control on the
form, the subform control, which must be referenced as a control before any
of the controls residing on it can be referenced.

Therefore, if the TransactionDate text box resides on the main form and the
DateCalendar calendar control resides on the subform, then try:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
Me!MyCtrl.Form.DateCalendar.Visible = True
Me!MyCtrl.Form.DateCalendar.SetFocus
If Not IsNull(Me!TransactionDate.Value) Then
Me!MyCtrl.Form.DateCalendar.Value = Me!TransactionDate.Value
Else
Me!MyCtrl.Form.DateCalendar.Value = Date
End If
End Sub

.. . . where MyCtrl is the name of the subform control.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


"shep" wrote:

Using MS Office 2003 Pro
I am trying to add a popup calendar to a subform to enable users to select
date vice typing it in a date field. I have done this on several forms, but
cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't
move the focus to the control DateCalendar " Here is code that works on forms:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

Is there a way to get this to work on the subform?

Thanks

  #3  
Old November 4th, 2005, 11:15 PM
Darhl Thomason
external usenet poster
 
Posts: n/a
Default Popup Calendar

Don't reinvent the wheel...I just asked this exact question three days ago
and got some great ideas, the best of which I felt could be found at and
downloaded for free from http://allenbrowne.com/ser-51.html

Allen's got a great Access site that is now in my favorites list.

Good luck!

"shep" wrote in message
news
Using MS Office 2003 Pro
I am trying to add a popup calendar to a subform to enable users to select
date vice typing it in a date field. I have done this on several forms,
but
cannot get it to work on the subform. I get "error msg 2110 MS ACCESS
can't
move the focus to the control DateCalendar " Here is code that works on
forms:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer,
X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

Is there a way to get this to work on the subform?

Thanks


  #4  
Old November 5th, 2005, 01:50 PM
shep
external usenet poster
 
Posts: n/a
Default Popup Calendar



"'69 Camaro" wrote:
Thanks for your response
The date field and calerndar control are on the subform. Your explanation
about the subform's status when the form is open may be why it is not setting
focus of the calendar control. It may be that the setfocus function is
controlled by the form.

Hopefully there is a way to code it so the calendar will work on the subform.

Thanks again for your help.
Hi, Shep.

If the TransactionDate text box resides on the main form and the
DateCalendar calendar control resides on the subform, then find out the name
of the subform control. This is _not_ the name of the subform, unless you've
made the mistake of naming them the same. Whenever the main form is open,
the subform _doesn't_ exist. It's being "held" by a special control on the
form, the subform control, which must be referenced as a control before any
of the controls residing on it can be referenced.

Therefore, if the TransactionDate text box resides on the main form and the
DateCalendar calendar control resides on the subform, then try:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
Me!MyCtrl.Form.DateCalendar.Visible = True
Me!MyCtrl.Form.DateCalendar.SetFocus
If Not IsNull(Me!TransactionDate.Value) Then
Me!MyCtrl.Form.DateCalendar.Value = Me!TransactionDate.Value
Else
Me!MyCtrl.Form.DateCalendar.Value = Date
End If
End Sub

. . . where MyCtrl is the name of the subform control.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


"shep" wrote:

Using MS Office 2003 Pro
I am trying to add a popup calendar to a subform to enable users to select
date vice typing it in a date field. I have done this on several forms, but
cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't
move the focus to the control DateCalendar " Here is code that works on forms:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

Is there a way to get this to work on the subform?

Thanks

  #5  
Old November 5th, 2005, 01:52 PM
shep
external usenet poster
 
Posts: n/a
Default Popup Calendar

Did you get a popup calendar to work on a subform? If so, will you share the
code with me?

Thanks

"Darhl Thomason" wrote:

Don't reinvent the wheel...I just asked this exact question three days ago
and got some great ideas, the best of which I felt could be found at and
downloaded for free from http://allenbrowne.com/ser-51.html

Allen's got a great Access site that is now in my favorites list.

Good luck!

"shep" wrote in message
news
Using MS Office 2003 Pro
I am trying to add a popup calendar to a subform to enable users to select
date vice typing it in a date field. I have done this on several forms,
but
cannot get it to work on the subform. I get "error msg 2110 MS ACCESS
can't
move the focus to the control DateCalendar " Here is code that works on
forms:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer,
X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

Is there a way to get this to work on the subform?

Thanks




  #6  
Old November 5th, 2005, 03:33 PM
'69 Camaro
external usenet poster
 
Posts: n/a
Default Popup Calendar

Hi, Shep.

If both the date text box and the calendar control are on the subform, then
your code should work, unless you wrote code elsewhere -- or changed the
calendar control's property -- that interferes with this.

Did you disable the calendar control? Check the DateCalendar's "Data" tab
in the Properties dialog window. The Enabled Property should be set to Yes.
If it is, then search through the code for the following:

DateCalendar.Enabled = False

The DateCalendar must be enabled when the focus is set to it. If you can't
find where it's been disabled, then in your subform's module try:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.Enabled = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


"shep" wrote:



Thanks for your response
The date field and calerndar control are on the subform. Your explanation
about the subform's status when the form is open may be why it is not setting
focus of the calendar control. It may be that the setfocus function is
controlled by the form.

Hopefully there is a way to code it so the calendar will work on the subform.

Thanks again for your help.
"'69 Camaro" wrote:
Hi, Shep.

If the TransactionDate text box resides on the main form and the
DateCalendar calendar control resides on the subform, then find out the name
of the subform control. This is _not_ the name of the subform, unless you've
made the mistake of naming them the same. Whenever the main form is open,
the subform _doesn't_ exist. It's being "held" by a special control on the
form, the subform control, which must be referenced as a control before any
of the controls residing on it can be referenced.

Therefore, if the TransactionDate text box resides on the main form and the
DateCalendar calendar control resides on the subform, then try:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
Me!MyCtrl.Form.DateCalendar.Visible = True
Me!MyCtrl.Form.DateCalendar.SetFocus
If Not IsNull(Me!TransactionDate.Value) Then
Me!MyCtrl.Form.DateCalendar.Value = Me!TransactionDate.Value
Else
Me!MyCtrl.Form.DateCalendar.Value = Date
End If
End Sub

. . . where MyCtrl is the name of the subform control.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


"shep" wrote:

Using MS Office 2003 Pro
I am trying to add a popup calendar to a subform to enable users to select
date vice typing it in a date field. I have done this on several forms, but
cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't
move the focus to the control DateCalendar " Here is code that works on forms:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

Is there a way to get this to work on the subform?

Thanks

  #7  
Old November 5th, 2005, 06:03 PM
Arvin Meyer [MVP]
external usenet poster
 
Posts: n/a
Default Popup Calendar

Use my calendar at:

http://www.datastrat.com/Download/Calendar2K.zip

Simply import the calendar for and the module into your database, and use
the double-click event in any date field to place the following expression :

=popCalendar()

Works in forms, subforms and can be converted to every version of Access.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"shep" wrote in message
...
Did you get a popup calendar to work on a subform? If so, will you share

the
code with me?

Thanks

"Darhl Thomason" wrote:

Don't reinvent the wheel...I just asked this exact question three days

ago
and got some great ideas, the best of which I felt could be found at and
downloaded for free from http://allenbrowne.com/ser-51.html

Allen's got a great Access site that is now in my favorites list.

Good luck!

"shep" wrote in message
news
Using MS Office 2003 Pro
I am trying to add a popup calendar to a subform to enable users to

select
date vice typing it in a date field. I have done this on several

forms,
but
cannot get it to work on the subform. I get "error msg 2110 MS ACCESS
can't
move the focus to the control DateCalendar " Here is code that works

on
forms:

Private Sub TransactionDate_MouseDown(Button As Integer, Shift As

Integer,
X
As Single, Y As Single)
DateCalendar.Visible = True
DateCalendar.SetFocus
If Not IsNull(TransactionDate) Then
DateCalendar.Value = TransactionDate.Value
Else
DateCalendar.Value = Date
End If
End Sub

Is there a way to get this to work on the subform?

Thanks






  #8  
Old November 6th, 2005, 03:41 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default Popup Calendar

The calendar Darhl refers to works on any level of subform.

Just use the name of the text box in the Click event of the button,
regardless of whether it is in a main form or a subform.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"shep" wrote in message
...
Did you get a popup calendar to work on a subform? If so, will you share
the
code with me?

Thanks

"Darhl Thomason" wrote:

Don't reinvent the wheel...I just asked this exact question three days
ago
and got some great ideas, the best of which I felt could be found at and
downloaded for free from http://allenbrowne.com/ser-51.html

Allen's got a great Access site that is now in my favorites list.

Good luck!



  #9  
Old November 6th, 2005, 03:15 PM
shep
external usenet poster
 
Posts: n/a
Default Popup Calendar

Thanks for your response. I did get your calendar to work on forms, but on
this subform the icon did not show. I think I have a gremlin in this subform.

Thank you

"Allen Browne" wrote:

The calendar Darhl refers to works on any level of subform.

Just use the name of the text box in the Click event of the button,
regardless of whether it is in a main form or a subform.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"shep" wrote in message
...
Did you get a popup calendar to work on a subform? If so, will you share
the
code with me?

Thanks

"Darhl Thomason" wrote:

Don't reinvent the wheel...I just asked this exact question three days
ago
and got some great ideas, the best of which I felt could be found at and
downloaded for free from http://allenbrowne.com/ser-51.html

Allen's got a great Access site that is now in my favorites list.

Good luck!




  #10  
Old November 6th, 2005, 03:28 PM
shep
external usenet poster
 
Posts: n/a
Default Popup Calendar

I did get your calendar to work on a form, but on this subform the icon did
not show. I think I have a gremlin in this subform. More likely I have met
the enemy and it is me.

Thanks for your help.

"Allen Browne" wrote:

The calendar Darhl refers to works on any level of subform.

Just use the name of the text box in the Click event of the button,
regardless of whether it is in a main form or a subform.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"shep" wrote in message
...
Did you get a popup calendar to work on a subform? If so, will you share
the
code with me?

Thanks

"Darhl Thomason" wrote:

Don't reinvent the wheel...I just asked this exact question three days
ago
and got some great ideas, the best of which I felt could be found at and
downloaded for free from http://allenbrowne.com/ser-51.html

Allen's got a great Access site that is now in my favorites list.

Good luck!




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing my Calendar Chaplain Doug Calendar 0 August 22nd, 2005 04:21 PM
Calendars in OL2003/OL2000 Rich General Discussion 16 February 10th, 2005 12:41 AM
Group calendar stranegly loses appointments a while after theire m Tim de Jager Calendar 1 July 21st, 2004 04:51 PM
Sync Outlook 2002 SP2 Personal Calendar with Exchange Calendar Larry Calendar 0 May 29th, 2004 12:06 AM
Calendar and Public Exchange Folder Markus Broy Calendar 2 May 29th, 2004 12:01 AM


All times are GMT +1. The time now is 12:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.