From: HLCruz via on
I am using access 2007 and I have a form that has a date field, the Show Date
Picker is set to "for dates", however the calendar never appears.

I am using the following code (from the Acces Cookbook) on a toggle control.
The purpose of the code is to allow the users to carry that date forward when
entering multiple payments for a singe day.

Is this code prohibiting my Date Picker from working? Or do I have another
sort of problem? Thanks to anyone willing to help.

Dim ctlData As Control
Const acbcQuote = """"

' The name of the data control this
' toggle control serves is stored in
' the toggle control's Tag property
Set ctlData = frm(ctlToggle.Tag)

If ctlToggle.Value Then
' If the toggle button is depressed
' then place current carry field control
' into the control's DefaultValue property.
' But first, store away existing DefaultValue,
' if any, in the control's Tag property
If Len(ctlData.DefaultValue) > 0 Then
ctlData.Tag = ctlData.DefaultValue
End If
ctlData.DefaultValue = _
acbcQuote & ctlData.Value & acbcQuote
' Toggle button unpressed, so restore
' text box's DefaultValue if there is a
' non-empty Tag property.
If Len(ctlData.Tag) > 0 Then
ctlData.DefaultValue = ctlData.Tag
ctlData.Tag = ""
ctlData.DefaultValue = ""
End If
End If
End Function

Message posted via