Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Equipment Access
Kenneth B 
    
13 years ago
Thanks That worked Perfectly! New Problem If The Employee has no Records In EmpEquipmentAccessT Then it Lets them Check out anything Instead of Denying Everything



Private Sub Combo10_BeforeUpdate(Cancel As Integer)


Dim E
Dim X


X = DLookup("EquipmentID", "EmpEquipmentAccessT", "EmpID=" & EmpID)

If Combo10 <> X Then
E = MsgBox("Employee is NOT Authorized to check out this Equipment. " & _
"Employee must contact his or her Supervisor to request access.", vbOKOnly + vbExclamation, "Not Autherized To Check Out")
Cancel = True
Me.Undo
End If


If InService = False Then
E = MsgBox("This equipment is currently out of service " & _
"and can not be checked out at this time.", vbOKOnly + vbExclamation, "Equipment Is Out Of Service")
Cancel = True
Me.Undo
End If

If IsAvailable = False Then
E = MsgBox("This equipment has already been checked out. It must first be checked back in " & _
"before it can be checked out again.", vbOKOnly + vbExclamation, "Equipment Is Already Out")
Cancel = True
Me.Undo
End If


Reply from Richard Rost:

Wrap your DLOOKUP inside of an NZ() function which will convert NULL values to ZERO.

X = NZ(DLOOKUP(...),0)
IF X=0 then you have a null value


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

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/18/2026 3:31:47 AM. PLT: 0s