Date Picker in Access 2010

PiedPiper70

Registered User.
Local time
Today, 13:22
Joined
Oct 21, 2012
Messages
115
I can't find the defintive answer to this - is there a smart way to disable the data picker for every field on every form in my application - without doing it the long winded way of manually turning it off for every field?

Thanks
Dave
 
Loop through the controls of the form, then set the Format to nothing.
 
Thanks for reply. I tried cobbling together a little code, which appears to work without error but does nothing. Any thoughts?

Function FixAllForms()
Dim accobj As AccessObject
For Each accobj In CurrentProject.AllForms
Call FixDatePicker(accobj.name)
Next
End Function

Function FixDatePicker(strFormName As String, Optional bSaveAndClose As Boolean, Optional bHidden As Boolean)

Dim frm As Form
Dim ctl As Control
Dim strName As String
Dim bChanged As Boolean

DoCmd.OpenForm strFormName, acDesign, windowmode:=IIf(bHidden, acHidden, acWindowNormal)
Set frm = Forms(strFormName)

For Each ctl In frm.Controls
If ctl.ControlType = acTextBox Then
ctl.ShowDatePicker = False
End If
Next

Set ctl = Nothing
Set frm = Nothing
If Not bChanged Then
DoCmd.Close acForm, strFormName, acSaveNo
ElseIf bSaveAndClose Then
DoCmd.Close acForm, strFormName, acSaveYes
End If

End Function

Thanks
Dave
 

Users who are viewing this thread

Back
Top Bottom