Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   Courses   Seminars   Templates   Help   TechHelp   Forums   Contact   Join   Order   Logon  
 
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 Twitter 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
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
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
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
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn