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

Popup Calendar Question

P: n/a
A while back I had found a link to a popup calendar that had a small
button that was placed to the right of any text box. By clicking on
the icon and selecting a date the text box was updated with that date.
You were able to use the icon (button) on multiple text boxes on the
form. I have lost the link and can't find any reference to it on my
machine.

Could someone lead me in the right direction?

Thank you.
Dec 1 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Using http://groups.google.com to search this and some microsoft.public...
newsgroups on "calendar control" "calendar form" or "date picker" will give
you more references than you'll want to pursue. From my own personal
experience, MVP Arvin Meyer has a data picker at his site
http://www.datastrat.com, MVP Stephen Lebans has a date picker at his site
http://www.lebans.com, and Drew Wutka has one at his site
http://www.wolfwares.com. But there are many, many others, in addition to
the calendar control distributed with recent versions of Access (if I am
correct, that distributed control is an ActiveX and I'd prefer one
implemented with native features of Access).

All of these, if memory serves, are implemented with forms and controls that
are native to Access, and do not introduce the complications that can result
from using ActiveX controls to extend Access' capability.

Larry Linson
Microsoft Access MVP
"ShyGuy" <sh****@shytown.comwrote in message
news:oq********************************@4ax.com...
>A while back I had found a link to a popup calendar that had a small
button that was placed to the right of any text box. By clicking on
the icon and selecting a date the text box was updated with that date.
You were able to use the icon (button) on multiple text boxes on the
form. I have lost the link and can't find any reference to it on my
machine.

Could someone lead me in the right direction?

Thank you.

Dec 1 '06 #2

P: n/a
Thanks for your reply. I had done a bit of searching before posting
here, but have been unable to find the popup calendar that I had seen.
I remember a module or two and you could just copy the Icon (button)
to the right of as many text boxes as you liked. That was the part I
really liked about it. I did find one that was similar but you have
to place a line of code behind each instance. Not a big deal. I
know. ;-) I'll probobly wind up using this one.

Thanks again for your help.
On Fri, 01 Dec 2006 04:27:15 GMT, "Larry Linson"
<bo*****@localhost.notwrote:
>Using http://groups.google.com to search this and some microsoft.public...
newsgroups on "calendar control" "calendar form" or "date picker" will give
you more references than you'll want to pursue. From my own personal
experience, MVP Arvin Meyer has a data picker at his site
http://www.datastrat.com, MVP Stephen Lebans has a date picker at his site
http://www.lebans.com, and Drew Wutka has one at his site
http://www.wolfwares.com. But there are many, many others, in addition to
the calendar control distributed with recent versions of Access (if I am
correct, that distributed control is an ActiveX and I'd prefer one
implemented with native features of Access).

All of these, if memory serves, are implemented with forms and controls that
are native to Access, and do not introduce the complications that can result
from using ActiveX controls to extend Access' capability.

Larry Linson
Microsoft Access MVP
"ShyGuy" <sh****@shytown.comwrote in message
news:oq********************************@4ax.com.. .
>>A while back I had found a link to a popup calendar that had a small
button that was placed to the right of any text box. By clicking on
the icon and selecting a date the text box was updated with that date.
You were able to use the icon (button) on multiple text boxes on the
form. I have lost the link and can't find any reference to it on my
machine.

Could someone lead me in the right direction?

Thank you.
Dec 1 '06 #3

P: n/a
ShyGuy wrote:
A while back I had found a link to a popup calendar that had a small
button that was placed to the right of any text box. By clicking on
the icon and selecting a date the text box was updated with that date.
You were able to use the icon (button) on multiple text boxes on the
form. I have lost the link and can't find any reference to it on my
machine.

Could someone lead me in the right direction?

Thank you.
Here's something I tried in A97. I'm not sure I'm doing it even close
to correctly, but it was fun trying.

frmDateIntoTextbox

txtFillFromPopup1 cmdTest1 (.Top = 0.5" for both)
txtFillFromPopup2 cmdTest2 (.Top = 0.8" for both)

'---Code behind frmDateIntoTextbox---
Option Compare Database
Option Explicit

Private Sub cmdTest1_Click()
DoCmd.OpenForm "frmPopupDatePicker"
End Sub

Private Sub cmdTest2_Click()
DoCmd.OpenForm "frmPopupDatePicker"
End Sub
'---End Code behind frmDateIntoTextbox---

frmPopupDatePicker (modal)

Built-in ActiveX Calendar control called PopUpDatePicker
cmdDone

'---Code behind frmPopupDatePicker---
Option Compare Database
Option Explicit

Dim MyClass As clsSelectedDate
Const TwipsPerInch = 1440

Private Sub cmdDone_Click()
DoCmd.Close acForm, Me.Name
End Sub

Private Sub Form_Load()
Set MyClass = New clsSelectedDate
MyClass.SelectedDate = Date
PopUpDatePicker.Value = Date
End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim ctl As Control

For Each ctl In Forms!frmDateIntoTextbox
If ctl.ControlType = acTextBox And Abs(ctl.Top - _
Forms!frmDateIntoTextbox.ActiveControl.Properties( "Top")) _
< 0.1 * TwipsPerInch Then
ctl.Value = MyClass.SelectedDate
End If
Next ctl

End Sub

Private Sub PopUpDatePicker_AfterUpdate()
MyClass.SelectedDate = PopUpDatePicker.Value
End Sub
'---End Code behind frmPopupDatePicker---

clsSelectedDate

'---Code in clsSelectedDate---
Option Compare Database
Option Explicit

Private mSelectedDate As Date

Public Property Let SelectedDate(dtIn As Date)
mSelectedDate = dtIn
End Property

Public Property Get SelectedDate() As Date
SelectedDate = mSelectedDate
End Property
'---End Code in clsSelectedDate---

When frmDateIntoTextbox is opened and one of the command buttons is
clicked, the form with the calendar control is opened. When cmdDone is
clicked, the date that was selected gets placed into any textboxes that
are vertically close to the command button that was clicked. I didn't
feel like trying to put the command buttons into a class. This might
not be even close to what you're looking for.

James A. Fortune
CD********@FortuneJames.com

Dec 1 '06 #4

P: n/a
On 1 Dec 2006 01:00:54 -0800, CD********@FortuneJames.com wrote:
>ShyGuy wrote:
>A while back I had found a link to a popup calendar that had a small
button that was placed to the right of any text box. By clicking on
the icon and selecting a date the text box was updated with that date.
You were able to use the icon (button) on multiple text boxes on the
form. I have lost the link and can't find any reference to it on my
machine.

Could someone lead me in the right direction?

Thank you.

Here's something I tried in A97. I'm not sure I'm doing it even close
to correctly, but it was fun trying.

frmDateIntoTextbox

txtFillFromPopup1 cmdTest1 (.Top = 0.5" for both)
txtFillFromPopup2 cmdTest2 (.Top = 0.8" for both)

'---Code behind frmDateIntoTextbox---
Option Compare Database
Option Explicit

Private Sub cmdTest1_Click()
DoCmd.OpenForm "frmPopupDatePicker"
End Sub

Private Sub cmdTest2_Click()
DoCmd.OpenForm "frmPopupDatePicker"
End Sub
'---End Code behind frmDateIntoTextbox---

frmPopupDatePicker (modal)

Built-in ActiveX Calendar control called PopUpDatePicker
cmdDone

'---Code behind frmPopupDatePicker---
Option Compare Database
Option Explicit

Dim MyClass As clsSelectedDate
Const TwipsPerInch = 1440

Private Sub cmdDone_Click()
DoCmd.Close acForm, Me.Name
End Sub

Private Sub Form_Load()
Set MyClass = New clsSelectedDate
MyClass.SelectedDate = Date
PopUpDatePicker.Value = Date
End Sub
Thnaks for the reply. I will have to study your code. But I did
finally find the code I was looking for at
http://www.peterssoftware.com/prx.htm

Import some modules and 1 form and paste the icon (button) to the
right of any text box and your done. Works beautifully.
>Private Sub Form_Unload(Cancel As Integer)
Dim ctl As Control

For Each ctl In Forms!frmDateIntoTextbox
If ctl.ControlType = acTextBox And Abs(ctl.Top - _
Forms!frmDateIntoTextbox.ActiveControl.Properties( "Top")) _
< 0.1 * TwipsPerInch Then
ctl.Value = MyClass.SelectedDate
End If
Next ctl

End Sub

Private Sub PopUpDatePicker_AfterUpdate()
MyClass.SelectedDate = PopUpDatePicker.Value
End Sub
'---End Code behind frmPopupDatePicker---

clsSelectedDate

'---Code in clsSelectedDate---
Option Compare Database
Option Explicit

Private mSelectedDate As Date

Public Property Let SelectedDate(dtIn As Date)
mSelectedDate = dtIn
End Property

Public Property Get SelectedDate() As Date
SelectedDate = mSelectedDate
End Property
'---End Code in clsSelectedDate---

When frmDateIntoTextbox is opened and one of the command buttons is
clicked, the form with the calendar control is opened. When cmdDone is
clicked, the date that was selected gets placed into any textboxes that
are vertically close to the command button that was clicked. I didn't
feel like trying to put the command buttons into a class. This might
not be even close to what you're looking for.

James A. Fortune
CD********@FortuneJames.com
Dec 2 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.