VBA code to search form field properties

Chris CA

New member
Local time
Today, 03:19
Joined
Jun 25, 2012
Messages
4
Not the database but the field properties on the form.
I previously had some code to do this (search forms) but I don't know where it is :banghead:.

Specifically...

I want to search all forms in the database for a Text Box field that is a date and change the Property Sheet Show Date Picker field from For dates to Never.


Thanks!
--
Chris
 
Here is some utility code to "reset forms" for each form in the database. You should be able to leverage that as a starting point.

Code:
  Dim obj As AccessObject
  Dim strThisForm As String

  For Each obj In CurrentProject.AllForms
    strThisForm = obj.Name
    If strThisForm <> Me.Name Then
      'Not self, so edit away!
      DoCmd.OpenForm strThisForm, acDesign, , , , acIcon
      With Forms(strThisForm)
        .Filter = vbNullString
        .FilterOn = False
        .OrderBy = vbNullString
        .OrderByOn = False
      End With
      DoCmd.Close acForm, strThisForm, acSaveYes
    End If
  Next obj
 
You are still very welcome, Chris! :cool:
 

Users who are viewing this thread

Back
Top Bottom