Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Assistance Available    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Access Assistance Available
jannette j 
    
8 years ago
i ahve a PLCTRacker database that im trying to make search properties work but i cant seem to get it to work right Private Sub RequeryProjNoList()

Dim WH As String
   Dim sql As String
   'Dim X As Integer
  
  
  
    WH = ""
   'Searches the Project Number
    If ProjectNo <> "" Then
        If WH <> "" Then WH = WH & " " & AndOrCombo & " "
        WH = WH & "ProjectNo LIKE '*" & ProjectNo & "*'"
    End If
    'Searches the Technician that worked on the project.
    If Technician <> "" Then
        If WH <> "" Then WH = WH & " " & AndOrCombo & " "
        WH = WH & "Technician LIKE '*" & Technician & "*'"
    End If
    'Searches the Departments Project Numbers
    If Department <> "" Then
        If WH <> "" Then WH = WH & " " & AndOrCombo & " "
        WH = WH & "Department LIKE '*" & Department & "*'"
    End If
    ' Searches the Keyword phrase in notes section
     If Notes <> "" Then
        If WH <> "" Then WH = WH & " " & AndOrCombo & " "
        WH = WH & "Keyword LIKE '*" & Notes & "*'"
     End If
     ' Search Criteria for Begining date
     If DateTo <> "" Then
        If WH <> "" Then WH = WH & " " & AndOrCombo & " "
         WH = WH & "DateEntered <= #" & DateTo & "#"
    End If
    
     If DateFrom <> "" Then
        If WH <> "" Then WH = WH & " " & AndOrCombo & " "
         WH = WH & "DateEntered <= #" & DateFrom & "#"
    End If
    
    If WH = "" Then
        MsgBox "Enter at least one parameter value."
        Exit Sub
    End If
    
    sql = "SELECT ProjectID, ProjectNo, Department, Technician, Notes, " & _
          "DateEntered FROM PLCTracker WHERE " & WH
    ProjNoList.RowSource = sql  ' sets the recordsource to the criteria we enter



Reply from Alex Hedley:

If you do a Debug.Print WH what shows in the output window in the VBA Editor?

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Assistance Available.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/17/2026 10:57:24 PM. PLT: 1s