From: James A. Fortune on
Perhaps some will find the following useful. With more and more date
fields showing up on forms lately, I decided to try to come up with a
better way to choose and validate date fields.

I created a form called frmPopUpDatePicker containing the following
controls:

PopUpDatePicker A97 Calendar ActiveX Control 8.0 (Note: A custom
calendar control/form can be used here instead.)
cmdDone Command Button labeled 'Insert Date' indicating that the
selected date is to be inserted into the control
cmdReturnBlank Command Button labeled 'Erase Date' indicating that the
control is to be set to Null
cmdCancel Command Button labeled 'Cancel' indicating that no action is
to be taken

I lock the control on a separate form, then put in a call to
frmPopUpDatePicker as shown below.

A control on any form (a textbox in this example) used as a date
container can call it something like:

Private Sub txtMyDateField_Click()
DoCmd.OpenForm "frmPopUpDatePicker", , , , , , Me.Name & "!" &
Me.ActiveControl.Name
End Sub

A similar control on a subform would call it something like:

Private Sub txtMyDateField_Click()
DoCmd.OpenForm "frmPopUpDatePicker", , , , , , "frmMain" & "!" & Forms!
frmMain!SubformMain.Name & "!" & Me.ActiveControl.Name
End Sub

Code behind frmPopupDatePicker:

----'begin code behind form----
Option Compare Database
Option Explicit

Dim boolSelection As Boolean
Dim boolBlank As Boolean
Dim boolCancel As Boolean
Dim varOriginal As Variant
Dim dtPopUp As Date
Dim ctl As Control
Const TwipsPerInch = 1440

Private Sub cmdCancel_Click()
boolCancel = True
DoCmd.Close acForm, Me.Name
End Sub

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

Private Sub cmdReturnBlank_Click()
boolBlank = True
DoCmd.Close acForm, Me.Name
End Sub

Private Sub Form_Load()
Dim strSubformControlName As String
Dim strFormName As String
Dim strControlName As String
Dim varOpenArgs As Variant

If IsNull(Me.OpenArgs) Then
MsgBox ("This form should not be opened by itself.")
DoCmd.Close acForm, Me.Name
Exit Sub
End If
boolSelection = False
boolBlank = False
boolCancel = False
varOpenArgs = Split(Me.OpenArgs, "!")
strFormName = varOpenArgs(0)
If UBound(varOpenArgs) = 2 Then
'E.g., Subform control: frmMain!SubformMain!txtX
strControlName = varOpenArgs(2) 'txtX
Set ctl = Forms(strFormName).Controls(varOpenArgs(1)).Controls
(strControlName)
Else
strControlName = varOpenArgs(1)
Set ctl = Forms(strFormName).Controls(strControlName)
End If
varOriginal = ctl.Value
'If the control contains a date then use that as the popup default
value
If Not IsNull(ctl.Value) Then
PopUpDatePicker.Value = ctl.Value
Else
PopUpDatePicker.Value = Date
boolSelection = True
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
If boolCancel = True Then
ctl.Value = varOriginal
ElseIf boolBlank = True Then
ctl.Value = Null
ElseIf boolSelection = True Then
ctl.Value = Format(dtPopUp, "mm/dd/yy")
End If
End Sub

Private Sub PopUpDatePicker_AfterUpdate()
dtPopUp = PopUpDatePicker.Value
boolSelection = True
End Sub
'----end code behind form----

When the control is clicked (I didn't consider using the OnEnter event
because most of my users use their mouse a lot), the PopUpDatePicker
form gives the user the option of inserting a date into the date
field, blanking the date field, or cancelling the action before
closing automatically. I only tested this using A97 with an an ad hoc
Split() function. Also, I did not test what would happen if two
controls on two separate forms use the PopUp form at the same time.
Furthermore, I did not consider making it work for a control on a
subform within a subform. It's not totally polished yet, but I think
I will be using it a lot.

James A. Fortune
CDMAPoster(a)FortuneJames.com

Disclaimer: Any programming examples shown are for illustration
purposes only, without warranty either expressed or implied. This
includes, but is not limited to, the implied warranties of
merchantability or fitness for a particular purpose. This post assumes
that you are familiar with the programming language that is being
demonstrated and with the tools that are used to create and to debug
procedures. I might explain the functionality of a particular
procedure, but I am under no obligation to modify these examples to
provide added functionality or to construct procedures to meet your
specific requirements. Any code samples posted contain no known
hidden material defects. However, anyone who uses any code sample
posted does so with the understanding that they are responsible for
any testing of any illustrative code sample for any particular use.
Furthermore, anyone using an illustrative code sample I provide or
code derived from it does so at their own risk.
From: Steve on
Jim,

How about this .........

You have a form named FrmOrder and on the form is a textbox bound to
OrderDate. You want to use a calendar to enter OrderDate rather than having
the user type it in.

1. Create a popup form named PFrmCalendar with a calendar control named
MyCalendar.
2. Also add a button named Cancel on PFrmCalendar.
3. In the AfterUpdate event of the calendar control put the following
code:
Me.Visible = False
4. In the Click event of the Cancel button put the following code:
DoCmd.Close

5. On FrmOrder, lock and disable OrderDate.
6. Add a button named Enter Order Date beside OrderDate.
7. Put the following code in the Click event of Enter Order Date:
DoCmd.OpenForm "PFrmCalendar",,,,,acDialog
If SysCmd(acSysCmdGetObjectState, acForm, "PFrmCalendar") =
acObjStateOpen Then
Me!OrderDate = Forms!PFrmCalendar!Calendar.Value
DoCmd.Close "PFrmCalendar"
End If

Clicking Enter Order Date on FrmOrder opens the calendar pop-up form. At
this point he user has two options. He can Cancel or click on a date on the
calendar. The calendar pop-up form opened in acDialog so the code for the
button on the main form is waiting for something to happen on the calendar
form. If the user cancels, the calendar form closes. The If code in the
Click event of Enter Order Date fails and OrderDate remains empty. If the
user clicks on a date in the calendar, the calendar form becomes invisible.
The If code in the Click event of Enter Order Date executes and OrderDate is
filled with the date that was clicked on. The calendar form then closes.

Steve
santus(a)penn.com





"James A. Fortune" <CDMAPoster(a)FortuneJames.com> wrote in message
news:8f47f945-3d34-478c-b966-6e5fe488e644(a)l35g2000vba.googlegroups.com...
> Perhaps some will find the following useful. With more and more date
> fields showing up on forms lately, I decided to try to come up with a
> better way to choose and validate date fields.
>
> I created a form called frmPopUpDatePicker containing the following
> controls:
>
> PopUpDatePicker A97 Calendar ActiveX Control 8.0 (Note: A custom
> calendar control/form can be used here instead.)
> cmdDone Command Button labeled 'Insert Date' indicating that the
> selected date is to be inserted into the control
> cmdReturnBlank Command Button labeled 'Erase Date' indicating that the
> control is to be set to Null
> cmdCancel Command Button labeled 'Cancel' indicating that no action is
> to be taken
>
> I lock the control on a separate form, then put in a call to
> frmPopUpDatePicker as shown below.
>
> A control on any form (a textbox in this example) used as a date
> container can call it something like:
>
> Private Sub txtMyDateField_Click()
> DoCmd.OpenForm "frmPopUpDatePicker", , , , , , Me.Name & "!" &
> Me.ActiveControl.Name
> End Sub
>
> A similar control on a subform would call it something like:
>
> Private Sub txtMyDateField_Click()
> DoCmd.OpenForm "frmPopUpDatePicker", , , , , , "frmMain" & "!" & Forms!
> frmMain!SubformMain.Name & "!" & Me.ActiveControl.Name
> End Sub
>
> Code behind frmPopupDatePicker:
>
> ----'begin code behind form----
> Option Compare Database
> Option Explicit
>
> Dim boolSelection As Boolean
> Dim boolBlank As Boolean
> Dim boolCancel As Boolean
> Dim varOriginal As Variant
> Dim dtPopUp As Date
> Dim ctl As Control
> Const TwipsPerInch = 1440
>
> Private Sub cmdCancel_Click()
> boolCancel = True
> DoCmd.Close acForm, Me.Name
> End Sub
>
> Private Sub cmdDone_Click()
> DoCmd.Close acForm, Me.Name
> End Sub
>
> Private Sub cmdReturnBlank_Click()
> boolBlank = True
> DoCmd.Close acForm, Me.Name
> End Sub
>
> Private Sub Form_Load()
> Dim strSubformControlName As String
> Dim strFormName As String
> Dim strControlName As String
> Dim varOpenArgs As Variant
>
> If IsNull(Me.OpenArgs) Then
> MsgBox ("This form should not be opened by itself.")
> DoCmd.Close acForm, Me.Name
> Exit Sub
> End If
> boolSelection = False
> boolBlank = False
> boolCancel = False
> varOpenArgs = Split(Me.OpenArgs, "!")
> strFormName = varOpenArgs(0)
> If UBound(varOpenArgs) = 2 Then
> 'E.g., Subform control: frmMain!SubformMain!txtX
> strControlName = varOpenArgs(2) 'txtX
> Set ctl = Forms(strFormName).Controls(varOpenArgs(1)).Controls
> (strControlName)
> Else
> strControlName = varOpenArgs(1)
> Set ctl = Forms(strFormName).Controls(strControlName)
> End If
> varOriginal = ctl.Value
> 'If the control contains a date then use that as the popup default
> value
> If Not IsNull(ctl.Value) Then
> PopUpDatePicker.Value = ctl.Value
> Else
> PopUpDatePicker.Value = Date
> boolSelection = True
> End If
> End Sub
>
> Private Sub Form_Unload(Cancel As Integer)
> If boolCancel = True Then
> ctl.Value = varOriginal
> ElseIf boolBlank = True Then
> ctl.Value = Null
> ElseIf boolSelection = True Then
> ctl.Value = Format(dtPopUp, "mm/dd/yy")
> End If
> End Sub
>
> Private Sub PopUpDatePicker_AfterUpdate()
> dtPopUp = PopUpDatePicker.Value
> boolSelection = True
> End Sub
> '----end code behind form----
>
> When the control is clicked (I didn't consider using the OnEnter event
> because most of my users use their mouse a lot), the PopUpDatePicker
> form gives the user the option of inserting a date into the date
> field, blanking the date field, or cancelling the action before
> closing automatically. I only tested this using A97 with an an ad hoc
> Split() function. Also, I did not test what would happen if two
> controls on two separate forms use the PopUp form at the same time.
> Furthermore, I did not consider making it work for a control on a
> subform within a subform. It's not totally polished yet, but I think
> I will be using it a lot.
>
> James A. Fortune
> CDMAPoster(a)FortuneJames.com
>
> Disclaimer: Any programming examples shown are for illustration
> purposes only, without warranty either expressed or implied. This
> includes, but is not limited to, the implied warranties of
> merchantability or fitness for a particular purpose. This post assumes
> that you are familiar with the programming language that is being
> demonstrated and with the tools that are used to create and to debug
> procedures. I might explain the functionality of a particular
> procedure, but I am under no obligation to modify these examples to
> provide added functionality or to construct procedures to meet your
> specific requirements. Any code samples posted contain no known
> hidden material defects. However, anyone who uses any code sample
> posted does so with the understanding that they are responsible for
> any testing of any illustrative code sample for any particular use.
> Furthermore, anyone using an illustrative code sample I provide or
> code derived from it does so at their own risk.


From: Keven Denen on
On Oct 20, 5:02 pm, "Steve" <notmyem...(a)address.com> wrote:
> Jim,
>
> How about this .........
>
> You have a form named FrmOrder and on the form is a textbox bound to
> OrderDate. You want to use a calendar to enter OrderDate rather than having
> the user type it in.
>
> 1.    Create a popup form named PFrmCalendar with a calendar control named
> MyCalendar.
> 2.    Also add a button named Cancel on PFrmCalendar.
> 3.    In the AfterUpdate event of the calendar control put the following
> code:
>         Me.Visible = False
> 4.    In the Click event of the Cancel button put the following code:
>         DoCmd.Close
>
> 5.    On FrmOrder, lock and disable OrderDate.
> 6.    Add a button named Enter Order Date beside OrderDate.
> 7.    Put the following code in the Click event of Enter Order Date:
>         DoCmd.OpenForm "PFrmCalendar",,,,,acDialog
>         If SysCmd(acSysCmdGetObjectState, acForm, "PFrmCalendar") =
> acObjStateOpen Then
>             Me!OrderDate = Forms!PFrmCalendar!Calendar.Value
>             DoCmd.Close "PFrmCalendar"
>         End If
>
> Clicking Enter Order Date on FrmOrder opens the calendar pop-up form. At
> this point he user has two options. He can Cancel or click on a date on the
> calendar. The calendar pop-up form opened in acDialog so the code for the
> button on the main form is waiting for something to happen on the calendar
> form. If the user cancels, the calendar form closes. The If code in the
> Click event of Enter Order Date fails and OrderDate remains empty. If the
> user clicks on a date in the calendar, the calendar form becomes invisible.
> The If code in the Click event of Enter Order Date executes and OrderDate is
> filled with the date that was clicked on. The calendar form then closes.
>
> Steve
> san...(a)penn.com
>
> "James A. Fortune" <CDMAPos...(a)FortuneJames.com> wrote in messagenews:8f47f945-3d34-478c-b966-6e5fe488e644(a)l35g2000vba.googlegroups.com...
>
>
>
> > Perhaps some will find the following useful.  With more and more date
> > fields showing up on forms lately, I decided to try to come up with a
> > better way to choose and validate date fields.
>
> > I created a form called frmPopUpDatePicker containing the following
> > controls:
>
> > PopUpDatePicker A97 Calendar ActiveX Control 8.0 (Note: A custom
> > calendar control/form can be used here instead.)
> > cmdDone Command Button labeled 'Insert Date' indicating that the
> > selected date is to be inserted into the control
> > cmdReturnBlank Command Button labeled 'Erase Date' indicating that the
> > control is to be set to Null
> > cmdCancel Command Button labeled 'Cancel' indicating that no action is
> > to be taken
>
> > I lock the control on a separate form, then put in a call to
> > frmPopUpDatePicker as shown below.
>
> > A control on any form (a textbox in this example) used as a date
> > container can call it something like:
>
> > Private Sub txtMyDateField_Click()
> > DoCmd.OpenForm "frmPopUpDatePicker", , , , , , Me.Name & "!" &
> > Me.ActiveControl.Name
> > End Sub
>
> > A similar control on a subform would call it something like:
>
> > Private Sub txtMyDateField_Click()
> > DoCmd.OpenForm "frmPopUpDatePicker", , , , , , "frmMain" & "!" & Forms!
> > frmMain!SubformMain.Name & "!" & Me.ActiveControl.Name
> > End Sub
>
> > Code behind frmPopupDatePicker:
>
> > ----'begin code behind form----
> > Option Compare Database
> > Option Explicit
>
> > Dim boolSelection As Boolean
> > Dim boolBlank As Boolean
> > Dim boolCancel As Boolean
> > Dim varOriginal As Variant
> > Dim dtPopUp As Date
> > Dim ctl As Control
> > Const TwipsPerInch = 1440
>
> > Private Sub cmdCancel_Click()
> > boolCancel = True
> > DoCmd.Close acForm, Me.Name
> > End Sub
>
> > Private Sub cmdDone_Click()
> > DoCmd.Close acForm, Me.Name
> > End Sub
>
> > Private Sub cmdReturnBlank_Click()
> > boolBlank = True
> > DoCmd.Close acForm, Me.Name
> > End Sub
>
> > Private Sub Form_Load()
> > Dim strSubformControlName As String
> > Dim strFormName As String
> > Dim strControlName As String
> > Dim varOpenArgs As Variant
>
> > If IsNull(Me.OpenArgs) Then
> >  MsgBox ("This form should not be opened by itself.")
> >  DoCmd.Close acForm, Me.Name
> >  Exit Sub
> > End If
> > boolSelection = False
> > boolBlank = False
> > boolCancel = False
> > varOpenArgs = Split(Me.OpenArgs, "!")
> > strFormName = varOpenArgs(0)
> > If UBound(varOpenArgs) = 2 Then
> >  'E.g., Subform control: frmMain!SubformMain!txtX
> >  strControlName = varOpenArgs(2) 'txtX
> >  Set ctl = Forms(strFormName).Controls(varOpenArgs(1)).Controls
> > (strControlName)
> > Else
> >  strControlName = varOpenArgs(1)
> >  Set ctl = Forms(strFormName).Controls(strControlName)
> > End If
> > varOriginal = ctl.Value
> > 'If the control contains a date then use that as the popup default
> > value
> > If Not IsNull(ctl.Value) Then
> >  PopUpDatePicker.Value = ctl.Value
> > Else
> >  PopUpDatePicker.Value = Date
> >  boolSelection = True
> > End If
> > End Sub
>
> > Private Sub Form_Unload(Cancel As Integer)
> > If boolCancel = True Then
> >  ctl.Value = varOriginal
> > ElseIf boolBlank = True Then
> >  ctl.Value = Null
> > ElseIf boolSelection = True Then
> >  ctl.Value = Format(dtPopUp, "mm/dd/yy")
> > End If
> > End Sub
>
> > Private Sub PopUpDatePicker_AfterUpdate()
> > dtPopUp = PopUpDatePicker.Value
> > boolSelection = True
> > End Sub
> > '----end code behind form----
>
> > When the control is clicked (I didn't consider using the OnEnter event
> > because most of my users use their mouse a lot), the PopUpDatePicker
> > form gives the user the option of inserting a date into the date
> > field, blanking the date field, or cancelling the action before
> > closing automatically.  I only tested this using A97 with an an ad hoc
> > Split() function.  Also, I did not test what would happen if two
> > controls on two separate forms use the PopUp form at the same time.
> > Furthermore, I did not consider making it work for a control on a
> > subform within a subform.  It's not totally polished yet, but I think
> > I will be using it a lot.
>
> > James A. Fortune
> > CDMAPos...(a)FortuneJames.com
>
> > Disclaimer:  Any programming examples shown are for illustration
> > purposes only, without warranty either expressed or implied. This
> > includes, but is not limited to, the implied warranties of
> > merchantability or fitness for a particular purpose. This post assumes
> > that you are familiar with the programming language that is being
> > demonstrated and with the tools that are used to create and to debug
> > procedures. I might explain the functionality of a particular
> > procedure, but I am under no obligation to modify these examples to
> > provide added functionality or to construct procedures to meet your
> > specific requirements.  Any code samples posted contain no known
> > hidden material defects.  However, anyone who uses any code sample
> > posted does so with the understanding that they are responsible for
> > any testing of any illustrative code sample for any particular use.
> > Furthermore, anyone using an illustrative code sample I provide or
> > code derived from it does so at their own risk.- Hide quoted text -
>
> - Show quoted text -

I prefer to use the Microsoft Date and Time Picker Control 6.0 (SP4).
Everything is built in and I've yet to find any problems with it as a
standard date picker. Of course in 2007 this isn't an issue anymore as
Date fields have this functionality built in.

Keven Denen
From: James A. Fortune on
On Oct 20, 7:24 pm, Keven Denen <keven.de...(a)gmail.com> wrote:
> On Oct 20, 5:02 pm, "Steve" <notmyem...(a)address.com> wrote:
>
>
>
> > Jim,
>
> > How about this .........
>
> > You have a form named FrmOrder and on the form is a textbox bound to
> > OrderDate. You want to use a calendar to enter OrderDate rather than having
> > the user type it in.
>
> > 1. Create a popup form named PFrmCalendar with a calendar control named
> > MyCalendar.
> > 2. Also add a button named Cancel on PFrmCalendar.
> > 3. In the AfterUpdate event of the calendar control put the following
> > code:
> > Me.Visible = False
> > 4. In the Click event of the Cancel button put the following code:
> > DoCmd.Close
>
> > 5. On FrmOrder, lock and disable OrderDate.
> > 6. Add a button named Enter Order Date beside OrderDate.
> > 7. Put the following code in the Click event of Enter Order Date:
> > DoCmd.OpenForm "PFrmCalendar",,,,,acDialog
> > If SysCmd(acSysCmdGetObjectState, acForm, "PFrmCalendar") =
> > acObjStateOpen Then
> > Me!OrderDate = Forms!PFrmCalendar!Calendar.Value
> > DoCmd.Close "PFrmCalendar"
> > End If
>
> > Clicking Enter Order Date on FrmOrder opens the calendar pop-up form. At
> > this point he user has two options. He can Cancel or click on a date on the
> > calendar. The calendar pop-up form opened in acDialog so the code for the
> > button on the main form is waiting for something to happen on the calendar
> > form. If the user cancels, the calendar form closes. The If code in the
> > Click event of Enter Order Date fails and OrderDate remains empty. If the
> > user clicks on a date in the calendar, the calendar form becomes invisible.
> > The If code in the Click event of Enter Order Date executes and OrderDate is
> > filled with the date that was clicked on. The calendar form then closes.
>
> > Steve
> > san...(a)penn.com
>
> > "James A. Fortune" <CDMAPos...(a)FortuneJames.com> wrote in messagenews:8f47f945-3d34-478c-b966-6e5fe488e644(a)l35g2000vba.googlegroups.com...
>
> > > Perhaps some will find the following useful. With more and more date
> > > fields showing up on forms lately, I decided to try to come up with a
> > > better way to choose and validate date fields.
>
> > > I created a form called frmPopUpDatePicker containing the following
> > > controls:
>
> > > PopUpDatePicker A97 Calendar ActiveX Control 8.0 (Note: A custom
> > > calendar control/form can be used here instead.)
> > > cmdDone Command Button labeled 'Insert Date' indicating that the
> > > selected date is to be inserted into the control
> > > cmdReturnBlank Command Button labeled 'Erase Date' indicating that the
> > > control is to be set to Null
> > > cmdCancel Command Button labeled 'Cancel' indicating that no action is
> > > to be taken
>
> > > I lock the control on a separate form, then put in a call to
> > > frmPopUpDatePicker as shown below.
>
> > > A control on any form (a textbox in this example) used as a date
> > > container can call it something like:
>
> > > Private Sub txtMyDateField_Click()
> > > DoCmd.OpenForm "frmPopUpDatePicker", , , , , , Me.Name & "!" &
> > > Me.ActiveControl.Name
> > > End Sub
>
> > > A similar control on a subform would call it something like:
>
> > > Private Sub txtMyDateField_Click()
> > > DoCmd.OpenForm "frmPopUpDatePicker", , , , , , "frmMain" & "!" & Forms!
> > > frmMain!SubformMain.Name & "!" & Me.ActiveControl.Name
> > > End Sub
>
> > > Code behind frmPopupDatePicker:
>
> > > ----'begin code behind form----
> > > Option Compare Database
> > > Option Explicit
>
> > > Dim boolSelection As Boolean
> > > Dim boolBlank As Boolean
> > > Dim boolCancel As Boolean
> > > Dim varOriginal As Variant
> > > Dim dtPopUp As Date
> > > Dim ctl As Control
> > > Const TwipsPerInch = 1440
>
> > > Private Sub cmdCancel_Click()
> > > boolCancel = True
> > > DoCmd.Close acForm, Me.Name
> > > End Sub
>
> > > Private Sub cmdDone_Click()
> > > DoCmd.Close acForm, Me.Name
> > > End Sub
>
> > > Private Sub cmdReturnBlank_Click()
> > > boolBlank = True
> > > DoCmd.Close acForm, Me.Name
> > > End Sub
>
> > > Private Sub Form_Load()
> > > Dim strSubformControlName As String
> > > Dim strFormName As String
> > > Dim strControlName As String
> > > Dim varOpenArgs As Variant
>
> > > If IsNull(Me.OpenArgs) Then
> > > MsgBox ("This form should not be opened by itself.")
> > > DoCmd.Close acForm, Me.Name
> > > Exit Sub
> > > End If
> > > boolSelection = False
> > > boolBlank = False
> > > boolCancel = False
> > > varOpenArgs = Split(Me.OpenArgs, "!")
> > > strFormName = varOpenArgs(0)
> > > If UBound(varOpenArgs) = 2 Then
> > > 'E.g., Subform control: frmMain!SubformMain!txtX
> > > strControlName = varOpenArgs(2) 'txtX
> > > Set ctl = Forms(strFormName).Controls(varOpenArgs(1)).Controls
> > > (strControlName)
> > > Else
> > > strControlName = varOpenArgs(1)
> > > Set ctl = Forms(strFormName).Controls(strControlName)
> > > End If
> > > varOriginal = ctl.Value
> > > 'If the control contains a date then use that as the popup default
> > > value
> > > If Not IsNull(ctl.Value) Then
> > > PopUpDatePicker.Value = ctl.Value
> > > Else
> > > PopUpDatePicker.Value = Date
> > > boolSelection = True
> > > End If
> > > End Sub
>
> > > Private Sub Form_Unload(Cancel As Integer)
> > > If boolCancel = True Then
> > > ctl.Value = varOriginal
> > > ElseIf boolBlank = True Then
> > > ctl.Value = Null
> > > ElseIf boolSelection = True Then
> > > ctl.Value = Format(dtPopUp, "mm/dd/yy")
> > > End If
> > > End Sub
>
> > > Private Sub PopUpDatePicker_AfterUpdate()
> > > dtPopUp = PopUpDatePicker.Value
> > > boolSelection = True
> > > End Sub
> > > '----end code behind form----
>
> > > When the control is clicked (I didn't consider using the OnEnter event
> > > because most of my users use their mouse a lot), the PopUpDatePicker
> > > form gives the user the option of inserting a date into the date
> > > field, blanking the date field, or cancelling the action before
> > > closing automatically. I only tested this using A97 with an an ad hoc
> > > Split() function. Also, I did not test what would happen if two
> > > controls on two separate forms use the PopUp form at the same time.
> > > Furthermore, I did not consider making it work for a control on a
> > > subform within a subform. It's not totally polished yet, but I think
> > > I will be using it a lot.
>
> > > James A. Fortune
> > > CDMAPos...(a)FortuneJames.com
>
> > > Disclaimer: Any programming examples shown are for illustration
> > > purposes only, without warranty either expressed or implied. This
> > > includes, but is not limited to, the implied warranties of
> > > merchantability or fitness for a particular purpose. This post assumes
> > > that you are familiar with the programming language that is being
> > > demonstrated and with the tools that are used to create and to debug
> > > procedures. I might explain the functionality of a particular
> > > procedure, but I am under no obligation to modify these examples to
> > > provide added functionality or to construct procedures to meet your
> > > specific requirements. Any code samples posted contain no known
> > > hidden material defects. However, anyone who uses any code sample
> > > posted does so with the understanding that they are responsible for
> > > any testing of any illustrative code sample for any particular use.
> > > Furthermore, anyone using an illustrative code sample I provide or
> > > code derived from it does so at their own risk.- Hide quoted text -
>
> > - Show quoted text -
>
> I prefer to use the Microsoft Date and Time Picker Control 6.0 (SP4).
> Everything is built in and I've yet to find any problems with it as a
> standard date picker. Of course in 2007 this isn't an issue anymore as
> Date fields have this functionality built in.
>
> Keven Denen

Thanks to both for the input. A97 is almost phased out where I work,
but A2K3 will linger on for a few more years. I suppose that both
Microsoft and I should have done this about 10 years ago :-),

James A. Fortune
CDMAPoster(a)FortuneJames.com
From: Bob Quintal on
"James A. Fortune" <CDMAPoster(a)FortuneJames.com> wrote in
news:790388f8-5a20-45f7-a68f-bcbaf523e767(a)b18g2000vbl.googlegroups.co
m:

>
> Thanks to both for the input. A97 is almost phased out where I
> work, but A2K3 will linger on for a few more years. I suppose
> that both Microsoft and I should have done this about 10 years ago
> :-),
>
> James A. Fortune
> CDMAPoster(a)FortuneJames.com
>

Or you can download Brendan Kidwell's datepicker, import the form and
code, and follow the instructions.

http://www.glump.net/software/microsoft_access_date_picker

--
Bob Quintal

PA is y I've altered my email address.