Computer Learning Zone CLZ Access Excel Word Windows

Live now; make now always the most precious time. Now will never come again.

-Jean-Luc Picard
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Search Seminar    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 

jannette jones 
    
8 years ago
I have designed a search for that i use to search a  ProjectNo and the search function works perfect but i have ADD button that adds a value to the list box so i can search that value on a fly. but it doesnt add the value to the list box im not sure why.
the code for the the  Add button is as follows.

Private Sub cmdAdd_Click()
Dim SQL As String
    Dim CID As Long

    On Error Resume Next
    If IsNull(Forms!frmPLCProject1!ProjectID) Then
        MsgBox "No current customer record open"
        Exit Sub
    End If
    
    
    'To check if the record set already exist  in the list so we dontr have duplicates -------------
    
    CID = Nz(DLookup("ProjectID", "ProjNoSearchT", "ProjectID=" & Forms!frmPLCProject1!ProjectID), 0)
    If CID <> 0 Then
        MsgBox "Customer already exists in search list"
        Exit Sub
    End If
    
    With Forms!frmPLCProject1
        SQL = "INSERT INTO ProjNoSearchT (ProjectID, ProjectNo, Technician,) " & _
            "VALUES (" & !ProjectID & ", #" & !ProjectNo & "#, """ & _
            !Technician & """)"
    End With
    DoCmd.SetWarnings False
    DoCmd.RunSQL SQL
    DoCmd.SetWarnings True
    ProjNoList.Requery
            
    
End Sub

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

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: 5/6/2026 7:31:02 AM. PLT: 1s