[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.3

Wildcard Search with a Field in a Sub Table

Asked by quizzer in Databases Miscellaneous, Microsoft Access Database

Tags: Access 2003

I have a Search Form setup that performs wildcard searches on Selected Fields with a Checkbox, based on whatever is entered in the Text Box Txt_Search.  It was also performing a search on the Combo Box cboCategory if a CategoryNewCode was selected.

Currently this works great.  Whatever Checkboxes get checked it perofrms a wildcard search of the fields checked.

The problem is that the customer now wants something different.  They want a combination Search, and they want it faster because currently I am Conctenating the CrossReference Field from a SubTable named tblCrossReference (Linked to the Main Table tblLegalFile PK LegalFileID to FK CrossReferenceID) into a single record.

Example If something is selected in cboCategory they want the recordsource limited to that AND serching for wildcards in all the cheked Boxes

In simple english If cboCategory is Null search through the checked Boxes.

If cboCategory Is Not Null Search limit the recordset specifically to the value selected in cboCategory AND then based on that filtered recordset Search through all of the checked boxes.

Also using a subquery can we search the field CrossReference without concatenating it and still filter the main recordsource of Frm_Main
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
On Error GoTo Err_Command4_Click
 
    Dim strWhere As String
    
    If Me.Txt_Search.Value <> "" Then
        If Me.CheckFileName.Value Then
            If strWhere <> "" Then
                strWhere = strWhere & " OR "
            End If
            strWhere = strWhere & "FileName Like '*" & Me.Txt_Search.Value & "*'"
        End If
        
        If Me.CheckSub1.Value Then
            If strWhere <> "" Then
                strWhere = strWhere & " OR "
            End If
            strWhere = strWhere & "Sub1 Like '*" & Me.Txt_Search.Value & "*'"
        End If
        
        If Me.CheckSub2.Value Then
            If strWhere <> "" Then
                strWhere = strWhere & " OR "
            End If
            strWhere = strWhere & "Sub2 Like '*" & Me.Txt_Search.Value & "*'"
        End If
        
        If Me.CheckComments.Value Then
            If strWhere <> "" Then
                strWhere = strWhere & " OR "
            End If
            strWhere = strWhere & "Comments Like '*" & Me.Txt_Search.Value & "*'"
        End If
        
        If Me.CheckLocationBox.Value Then
            If strWhere <> "" Then
                strWhere = strWhere & " OR "
            End If
            strWhere = strWhere & "LocationBox Like '*" & Me.Txt_Search.Value & "*'"
        End If
        If Me.CheckCrossReferences.Value Then
            If strWhere <> "" Then
                strWhere = strWhere & " OR "
            End If
            strWhere = strWhere & "CrossReferenceName Like '*" & Me.Txt_Search.Value & "*'"
            'MsgBox "I don't know how the table are related one to each other for Crossreference searching", vbInformation
        End If
    End If
    If Me.cboCategory.Value <> "" Then
        If strWhere <> "" Then
            strWhere = strWhere & " OR "
        End If
        strWhere = strWhere & "CategoryNewCode Like '*" & Me.cboCategory.Value & "*'"
    End If
    
  DoCmd.OpenForm "frm_main", acNormal, , strWhere
  
 
Exit_Command4_Click:
    Exit Sub
Err_Command4_Click:
    MsgBox Err.Description, vbCritical
    Resume Exit_Command4_Click
[+][-]05/08/09 09:30 PM, ID: 24342234Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Databases Miscellaneous, Microsoft Access Database
Tags: Access 2003
Sign Up Now!
Solution Provided By: boag2000
Participating Experts: 1
Solution Grade: B
 
[+][-]06/01/09 12:18 PM, ID: 24520790Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625