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 Developer 24 Lessons    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Failing to Copy Text from Field
Jasen Hicks 
     
2 years ago
Good Morning, this lesson has saved me a lot of headaches coming up with the best way to duplicate records and their children, but I am running into an issue. One of my table fields, TalkingPoint (similar to your Notes), won't copy the text over. I am trying to add (DUPLICATE) to the front, similar to your (COPY) but all it puts in the new record set is (DUPLICATE) - it seems to be ignoring the & rsOld!TalkingPoints portion... see code below:

    
DetailsSet rsOld = CurrentDb.OpenRecordset("SELECT * FROM tTalkingPoints WHERE idTalkingPoints=" & idTalkingPoints)
    Set rsNew = CurrentDb.OpenRecordset("tTalkingPoints")
    rsNew.AddNew
    NewID = rsNew!idTalkingPoints
    For Each Fld In rsOld.Fields
        If Fld.Name = "intendedDate" Then
            rsNew!intendedDate = Now
        ElseIf Fld.Name = "lastEditDate" Then
            rsNew!lastEditDate = Now
        ElseIf Fld.Name = "TalkingPoint" Then
            rsNew!TalkingPoint = "(DUPLICATED) " & rsOld!TalkingPoint
        ElseIf Fld.Name = "changeReason" Then
            rsNew!changeReason = "This talking point was duplicated from another taking point."
        ElseIf Fld.Name = "revisionX" Then
            rsNew!revisionX = 1
        ElseIf Fld.Name = "revisionY" Then
            rsNew!revisionY = 0
        ElseIf Fld.Name = "revisionZ" Then
            rsNew!revisionZ = 0
        ElseIf Fld.Name = "finalApproved" Then
            rsNew!finalApproved = No
        ElseIf Fld.Name <> "idTalkingPoints" Then
            rsNew(Fld.Name) = rsOld(Fld.Name)
        End If
    Next
    
    rsNew.Update
    rsNew.Close
    rsOld.Close

Jasen Hicks OP  @Reply  
     
2 years ago
If I remove the "(DUPLICATED) " it works as intended.

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

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: 4/12/2026 10:36:04 PM. PLT: 1s