Access 2007-2016
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 
Tips & Tricks

New Tips Added Weekly!
Click here to get on our Mailing List

   
 
Access Copy Last Record

Copy Last Record

Use DMAX and DLOOKUP to Copy the Last Record Entered

If you are entering a bunch of similar records, this tip will save you time. With one button you can copy the last record entered and any fields you want, while leaving some other fields blank for new data entry. For example, we will copy products and leave the serial number field blank. We will use the DMAX and DLOOKUP functions to accomplish this.


This tutorial explains how to do it...
 


 

Source Code

Here's the source code, if you want to copy and paste it:

Dim ID As Long
ID = DMax("ProductID", "ProductT")
DoCmd.GoToRecord , , acNewRec
ProductName = DLookup("ProductName", "ProductT", "ProductID=" & ID)
SalePrice = DLookup("SalePrice", "ProductT", "ProductID=" & ID)
DateEntered = DLookup("DateEntered", "ProductT", "ProductID=" & ID)
SerialNumber.SetFocus

 

Learn More About DLOOKUP...

I teach DLOOKUP my Access Expert Level 10 course.

Click this link to watch my FREE 2-hour long Access Beginner Level 1 course.

 

 


By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on Google Plus Richard Rost on LinkedIn Email Richard Rost

Click here to sign up for more FREE tips

 

You may want to read these articles from the 599CD News:

 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP