Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Recycle Bin 3    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Restore Record Does Not Allow Blanks
Monica Jones 
       
13 months ago
I've been through the code line by line multiple times and there is only one part I'm not sure of.

    'Step 2: open record and populate fields
    Set rsTarget = db.OpenRecordset("SELECT * FROM " & TableName & " WHERE " & KeyField & " = " & RecordID, dbOpenDynaset)

On Richard's screen the line cuts off at dbOpenDyna. I'm still quite new to making global functions but the above is how I completed the line.

It compiles, but when I try to run it for one table I get "Error in RestoreRecord: Field 'FilmT.Notes' cannot be a zero-length string." But it does restore the ID field. When I try it for MusicT I get "Error in RestoreRecord: You must enter a value in the 'MusicT.Artist' field." even when there is an artist there. And the ID field for MusicT is NOT restored.

Let me know what other parts of the code I should share to shed some light on this.

TIA,
Monica

Richard Rost  @Reply  
          
13 months ago
Your table has requirements for those fields in the table design. Looks like you have "allow zero length" set to NO for your Notes field. Artist looks like it's required. You'll have to deal with those issues OR just put an On Error Resume Next in the code where it starts setting those values, and they'll get skipped. Well, Artist won't get skipped because if it's required the whole record will fail. It should fix the zero length string issue.
Monica Jones OP  @Reply  
       
13 months ago
Ah! I totally forgot about making those required! I think I had artist and song as a “key field” long before converting to the way of auto number (aka Richardism) lol

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Recycle Bin 3.
 

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: 6/15/2026 12:54:44 AM. PLT: 1s