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 Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Set the Focus
Mai-Lan Aikens 
    
5 years ago
06/08/21
Many years ago, I acquired some code to allow me to have the cursor start on my first line of my forms. Even though I have changed the lines to correspond with each form, for some reason, I can no longer get it to work.
The code is,

Private Sub Form_Current()
If DateofPurchase.NewRecord = True Then
DateofPurchase.DateofPurchase.SetFocus
End If
End Sub

Previously, this has worked fine. But I can no longer get it to work.  I also clicked Debug, Compile. Still it doesnt work.
What I want is for the cursor to appear on the first line of the form instead of where it was left on the previous entry entered by end user. Thanks.
Alex Hedley  @Reply  
           
5 years ago
Why is DateofPurchase twice?
Adam Schwanz  @Reply  
           
5 years ago
Yea Alex has the solution if that's the actual code you're running. I'd assume it never worked like that, and that it just happened to be tab stop 1 for you and for some reason it's not any more.
Richard Rost  @Reply  
          
5 years ago
In the OnCurrent event for your form all you need is:

DateofPurchase.SetFocus

That's it. Assuming DateOfPurchase is the first field.

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

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/6/2026 12:48:26 PM. PLT: 0s