Public Sub TmpSerch(Signatura As String)
Dim frm As Form, odj As Object
Dim i As Integer, ctr As Control
CurrentProject.Connection.Execute "DELETE FROM _TmpSerch"
CurrentProject.Application.Echo False
For i = 0 To CurrentProject.AllForms.Count - 1
DoCmd.OpenForm CurrentProject.AllForms(i).Name, acDesign
Set frm = Forms(CurrentProject.AllForms(i).Name)
If InStr(frm.RecordSource, Signatura) <> 0 Then
CurrentProject.Connection.Execute "INSERT INTO _TmpSerch (ObjName,ObjType) VALUES('" & frm.Name & "','RecordSource')"
End If
For Each ctr In frm.Controls
If ctr.ControlType = acComboBox Or ctr.ControlType = acListBox Then
If InStr(ctr.RowSource, Signatura) <> 0 Then _
CurrentProject.Connection.Execute "INSERT INTO _TmpSerch (ObjName,ObjType) VALUES('" & frm.Name & "!" & ctr.Name & "','RowSource')"
End If
Next
DoCmd.Close acForm, frm.Name, acSaveNo
Next
CurrentProject.Application.Echo True
Set frm = Nothing |