Computer Learning Zone CLZ Access Excel Word Windows

The secret of freedom lies in educating people, whereas the secret of tyranny is in keeping them ignorant.

-Maximilien Robespierre
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Database Security Seminar    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
User Defined Type Error
Lisa Theodor 

13 years ago
Lesson 36 - I am getting a compile - user defined type not defined error.

***NOTE***:  I did not need the advanced security of disabling and hiding the windows.  I am wondering if something was set then that this is trying to reference and I don't have it.  My database has a logon and hidden buttons but not disable/enable keys for links, db windows or the bypass keys.  I have checked syntax several times and I cannot figure it out.

Here is my code - first line is highlighted yellow when I debug:
Public Sub LogIt(Description As String, Optional Notes As String = "")
    
    Dim ProgramLeaderID As Long
    Dim db As Database
    Dim rs As Recordset
    
    ' on error resume next
    ProgramLeaderID = Nz(Forms!mainmenu!txtProgramLeaderID)
    Set db = CurrentDb()
    Set rs = db.Openrecordset("log", dbopendynaset)
    rs.AddNew
    rs!ProgramLeaderID = ProgramLeaderID
    rs!Description = Description
    If Notes <> "" Then rs!Notes = Notes
    rs.update
    rs.Close
    Set rs = Nothing
    Set db = Nothing

What am I missing?

Thanks.
Lisa




Reply from Richard Rost:

Which line is highlighted yellow? If it's the "Dim db as Database" line then you're probably missing your DAO reference... covered in an earlier lesson.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Database Security 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/7/2026 8:12:14 PM. PLT: 1s