Computer Learning Zone CLZ Access Excel Word Windows

Ignorance is a virus. Once it starts spreading, it can only be cured by reason. For the sake of humanity, we must be that cure.

-Neil deGrasse Tyson
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Seminars > Work Order > Lessons
Back to Work Order Lessons    Comments List
Upload Images   @Reply   Bookmark    Link   Email  
Lesson 44
Neil deGrasse Tyson 
   
3 years ago
when i run the record set to update the InvoiceT i get the following error Compile error.  User-defined type not defined.  It then hgighlights the line db As Database.
Scott Axton  @Reply  
          
3 years ago
Check your typing / spelling.
You will probably have to post screenshots or snips of code.  There isn't enough information here to help you.
Lynda Chase OP  @Reply  
   
3 years ago
Hi, thanks for your reply, this is the code:
    Dim db As Database
    Dim rs As Recordset
    Set db = CurrentDb()
    Set rs = db.OpenRecordset("InvoiceT", dbOpenDynaset)
    rs.AddNew
    rs!WorkOrderID = WorkOrderID
    rs!InvoiceDate = Date
    rs!IsPaid = False
    rs.update
    rs.Close
    Set rs = Nothing
    Set db = Nothing
    
        

End Sub
Kevin Robertson  @Reply  
          
3 years ago
You may have a missing reference.
In the VB Editor go to Tools - References
Make sure the following is checked (see screenshot)

Microsoft Office 16.0 Access database engine Object Library
Kevin Robertson  @Reply  
          
3 years ago

Lynda Chase OP  @Reply  
   
3 years ago
Thank you, that fixed my problem.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Work Order Lessons.
 

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/22/2025 3:45:16 PM. PLT: 1s