Re: Seeking code to ID & print all controls having a ValidationRule property set - but no ValidationText
- From: MLH <CRCI@xxxxxxxxxxxxxx>
- Date: Thu, 16 Feb 2006 00:29:07 -0500
I'll have a go at this in A97. Thx 4 suggestion.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Thu, 16 Feb 2006 00:46:41 +0800, "Allen Browne"
<AllenBrowne@xxxxxxxxxxxxxx> wrote:
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
.
- Follow-Ups:
- References:
- Prev by Date: Re: Decompiling an A97 mdb file...
- Next by Date: Re: Help in proving that Access is an industrial strength front-end
- Previous by thread: Re: Seeking code to ID & print all controls having a ValidationRule property set - but no ValidationText
- Next by thread: Re: Seeking code to ID & print all controls having a ValidationRule property set - but no ValidationText
- Index(es):
Relevant Pages
|