Re: Seeking code to ID & print all controls having a ValidationRule property set - but no ValidationText



Perhaps something like this, if you are using Access 2000 or later:

Function FindRuleText()
Dim accobj As AccessObject
Dim ctl As Control
Dim strDoc As String

For Each accobj In CurrentProject.AllForms
strDoc = accobj.Name
DoCmd.OpenForm strDoc, acDesign, WindowMode:=acHidden
For Each ctl In Forms(strDoc).Controls
If HasProperty(ctl, "ValidationRule") Then
If (ctl.ValidationRule <> vbNullString) And
(ctl.ValidationText = vbNullString) Then
Debug.Print strDoc & "." & ctl.Name
End If
End If
Next
DoCmd.Close acForm, strDoc
Next
End Function
Public Function HasProperty(obj As Object, strPropName As String) As Boolean
'Purpose: Return true if the object has the property.
Dim varDummy As Variant
On Error Resume Next
varDummy = obj.Properties(strPropName)
HasProperty = (Err.Number = 0)
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CRCI@xxxxxxxxxxxxxx> wrote in message
news:hkk6v15mcmut08ug90sfnjjpi1iso444bl@xxxxxxxxxx
Seeking code to ID & print all controls on all forms having a
ValidationRule property set - but no ValidationText property
setting. Perhaps some modification of the following procedure
would do it?


.



Relevant Pages

  • Re: Using NotInList to update tabel with two values
    ... > Private Sub CountryName_NotInList(NewData As String, ... > Dim strSQL As String ... > Dim ctl As Control ... > the African countries are preselected) the NotIn List does not work. ...
    (microsoft.public.access.formscoding)
  • RE: Multi Select List Box
    ... Dim varItem As Variant ... Dim strWhere As String ... Dim strDelim As String ... Dim strDoc As String ...
    (microsoft.public.access.forms)
  • RE: Multi Select List Box
    ... Dim varItem As Variant ... Dim strWhere As String ... Dim strDelim As String ... Dim strDoc As String ...
    (microsoft.public.access.forms)
  • RE: Outlook automation with info from Access forms
    ... Function SetAppt(dteDeadline As Date, strType As String, strDoc As String) ... Dim objOutlkApp As Outlook.Application ... Set objOutlook = Outlook.Application ...
    (microsoft.public.office.developer.automation)
  • Re: Find and Replace Paragraphs - better explanation
    ... Dim objP As Paragraph ... Dim strDir As String ... Dim strBadTxt As String ... Dim strDoc As String ...
    (microsoft.public.word.vba.general)