Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT
Replace(Replace([Name],"~sq_c"," "),"~sq_f"," ") AS ObjectName,
MSysQueries.Expression
FROM
MSysObjects
INNER JOIN
MSysQueries
ON
MSysObjects.Id = MSysQueries.ObjectId
WHERE
(((MSysQueries.Expression) Like "*" & [Enter Field Name] & "*"))
ORDER BY
Replace(Replace([Name],"~sq_c"," "),"~sq_f"," ");
Public Function getFieldUse(fldName As String) As String
Dim frm As AccessObject
Dim rpt As AccessObject
Dim ctl As Access.Control
On Error Resume Next
For Each frm In CurrentProject.AllForms
DoCmd.OpenForm frm.name, acDesign, , , , acHidden
For Each ctl In Forms(frm.name).Controls
If isValidControl(ctl) Then
If ctl.ControlSource = fldName Then
getFieldUse = getFieldUse & "Form: " & frm.name & " Control: " & ctl.name & vbCrLf
End If
End If
Next ctl
DoCmd.Close acForm, frm.name
Next frm
For Each rpt In CurrentProject.AllReports
DoCmd.OpenReport rpt.name, acViewDesign, , , acHidden
For Each ctl In Reports(rpt.name).Controls
If isValidControl(ctl) Then
If ctl.ControlSource = fldName Then
getFieldUse = getFieldUse & "Report: " & rpt.name & " Control: " & ctl.name & vbCrLf
End If
End If
Next ctl
DoCmd.Close acReport, rpt.name
Next rpt
End Function
Public Function isValidControl(ctl As Access.Control) As Boolean
Select Case ctl.ControlType
Case acListBox, acComboBox, acTextBox, acComboBox
isValidControl = True
End Select
End Function
Public Sub FindField()
Dim fieldName As String
fieldName = InputBox("Enter Field Name")
Debug.Print getFieldUse(fieldName)
End Sub