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 Forum    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
Soft Delete in Order Entry Sys
Kevin Tuttle 
    
3 years ago
I use the Order Entry System to keep track of all my orders from different suppliers for my business and I love it and makes my tracking a lot easier.  Over the years I have tweeked to my liking.  Now I have a list of products that I no longer purchase or the supplier has discontinued.  I dont want to delete those products and, I have made a IsActive query and a NotActive query that Mr. Rost has shown. but I can not figure out how to run the IsActive from the add product button in my order form which is not bound and uses a SELECT, FROM statement in the row source.  Thanks
Scott Axton  @Reply  
      
3 years ago
What is the code or data source for your Add Product button currently?
You probably just need to change that to your IsActive query.

Screenshots?
Kevin Tuttle OP  @Reply  
    
3 years ago
Private Sub AddBtn_Click()

    If IsNull(ProductCombo) Then
        DoCmd.GoToControl "ProductCombo"
        ProductCombo.Dropdown
        Exit Sub
    End If
    
    If IsNull(Forms!OrderF!OrderID) Then
        Forms!OrderF!OrderDate = Date
        Forms!OrderF.Refresh
    End If
    
    ' check for duplicate product on order
    Dim C As Long
    C = DCount("*", "OrderDetailT", "OrderID=" & OrderID & " AND ProductID=" & ProductCombo)
    If C > 0 Then
        ' product already exists on this order
        If MsgBox("WARNING! This product is already on this order. Do you want to add it again?", _
            vbYesNoCancel + vbExclamation) <> vbYes Then Exit Sub
    End If
    
    DoCmd.GoToRecord , , acNewRec
    DoCmd.GoToControl "Quantity"
    ProductID = ProductCombo
    ItemNumber = ProductCombo.Column(1)
    UM = ProductCombo.Column(2)
    ProductDescription = ProductCombo.Column(3)
    UnitPrice = ProductCombo.Column(4)
    Notes = Nz(DLookup("Notes", "ProductMasterT", "ProductID=" & ProductCombo), "")
    Me.Refresh
    
End Sub
Kevin Robertson  @Reply  
          
3 years ago
Add a Where condition to your Combo Box so you don't see inactive products.

WHERE IsActive=True
Scott Axton  @Reply  
      
3 years ago
For the rowsource of your combo box add the IsActive = True there.

It will look something like this:

SELECT ProductID, Description, UnitPrice, IsActive
FROM ProductT
WHERE IsActive =True
ORDER BY Description, UnitPrice;


This assumes IsActive is defaulted to True.
Kevin Tuttle OP  @Reply  
    
3 years ago
Thank you so much.  I knew it was a simple where condition but, I just could not figure out the placement.

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

Next Unseen

 
 
What's This?

 

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: 11/14/2026 3:57:26 AM. PLT: 0s