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 
Check In or Out Items
James Hopkins 
     
3 years ago
Hey Richard and the Guys, I using a Continuous Form where I can Check-Out or Check-In Equipment using a Button. I was wonder if there's an way that I could Update to Table that the Continuous Form is not using to get Data From? Here's is the VBA Code that I have below:


Private Sub BtnCheckInOutEquipment_Click()

    Dim EquipmentID As Long
    Dim EquipmentStatus As String
    
    Dim U1 As String
    Dim U2 As String
    
    EquipmentID = DLookup("EquipmentID", "EquipmentT", "EquipmentID=" & Me.EquipmentID)
  
    EquipmentStatus = DLookup("EquipmentStatus", "EquipmentT", "EquipmentID=" & Me.EquipmentID)
  
    LastID = Nz(DMax("AssetUsageHistoryID", "AssetUsageHistoryT", "EquipmentID=" & Me.EquipmentID), 0)
    
    If EquipmentStatus = "Unavailable" Then
        U1 = "UPDATE EquipmentT SET EquipmentStatus = 'Available'  WHERE EquipmentID=" & EquipmentID
        U2 = "UPDATE AssetUsageHistoryT SET InStock = True, DateIn=#" & Now() & "# WHERE AssetUsageHistoryID=" & LastID
        BtnCheckInOutEquipment.Caption = "Check-Out"
        
        DoCmd.SetWarnings False
        DoCmd.RunSQL U1
        DoCmd.RunSQL U2
        DoCmd.SetWarnings True
        
    ElseIf EquipmentStatus = "Available" Then
        DoCmd.OpenForm "EquipmentCheckOutF", , , , acFormAdd
        Forms!EquipmentCheckOutF!EquipmentID = EquipmentID
    End If
      
    Me.Requery
    
End Sub

Also, I try DLookup the Data from the Table that I am trying to UPDATE....

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: 9/12/2026 3:38:12 PM. PLT: 1s