423,131 Members | 2,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,131 IT Pros & Developers. It's quick & easy.

My search doesn't contain the option to search complete project Access VBA

100+
P: 416
This just started Yesterday, I want to search for a variable in the complete project but the check box isn't there any more. The check boxes are not on any of those options. I also was going to remove the password while I copy some form from one program to another but the password would not let me blank it out, I keep getting the message invalid password. I'm not sure what I did but I could sure use some help.
Thanks.
Nov 4 '17 #1

✓ answered by twinnyfo

Hey Tom,

Just ran across this question of yours. It appears you have two separate questions. I may have some insight into the first, but not the second.

I am not exactly sure where, in your project you are searching, but I do have some useful functions that search the objects within a project. For example, the following searches all your modules for a particular search word:

Expand|Select|Wrap|Line Numbers
  1. Public Sub SearchModules(ByVal strSearch As String)
  2. On Error GoTo EH
  3.     Dim objComp     As Object
  4.     Dim strMsg      As String
  5.     Dim strModList  As String
  6.  
  7.     strModList = vbNullString
  8.  
  9.     For Each objComp In Application.VBE.ActiveVBProject.VBComponents
  10.         If objComp.CodeModule.Find(strSearch, 1, 1, -1, -1) = True Then
  11.             strModList = strModList & ";" & vbCrLf & Chr(9) & objComp.Name
  12.         End If
  13.     Next objComp
  14.  
  15.     strMsg = "Text '" & strSearch & "' found in "
  16.     If Len(strModList) > 0 Then
  17.         strMsg = strMsg & "modules:" & vbCrLf & Mid(strModList, 4)
  18.     Else
  19.         strMsg = strMsg & "no modules"
  20.     End If
  21.  
  22.     Debug.Print strMsg
  23.  
  24.     Exit Sub
  25. EH:
  26.     Resume Next
  27. End Sub
Not sure if this is the type of thing you were looking for, or something else.

Hope this hepps.

Share this Question
Share on Google+
1 Reply


twinnyfo
Expert Mod 100+
P: 2,499
Hey Tom,

Just ran across this question of yours. It appears you have two separate questions. I may have some insight into the first, but not the second.

I am not exactly sure where, in your project you are searching, but I do have some useful functions that search the objects within a project. For example, the following searches all your modules for a particular search word:

Expand|Select|Wrap|Line Numbers
  1. Public Sub SearchModules(ByVal strSearch As String)
  2. On Error GoTo EH
  3.     Dim objComp     As Object
  4.     Dim strMsg      As String
  5.     Dim strModList  As String
  6.  
  7.     strModList = vbNullString
  8.  
  9.     For Each objComp In Application.VBE.ActiveVBProject.VBComponents
  10.         If objComp.CodeModule.Find(strSearch, 1, 1, -1, -1) = True Then
  11.             strModList = strModList & ";" & vbCrLf & Chr(9) & objComp.Name
  12.         End If
  13.     Next objComp
  14.  
  15.     strMsg = "Text '" & strSearch & "' found in "
  16.     If Len(strModList) > 0 Then
  17.         strMsg = strMsg & "modules:" & vbCrLf & Mid(strModList, 4)
  18.     Else
  19.         strMsg = strMsg & "no modules"
  20.     End If
  21.  
  22.     Debug.Print strMsg
  23.  
  24.     Exit Sub
  25. EH:
  26.     Resume Next
  27. End Sub
Not sure if this is the type of thing you were looking for, or something else.

Hope this hepps.
Feb 14 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.