Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Date Time shown at the sametime
Gary 

15 years ago
Bob,
     There are several ways you can capture the date & time into a field. But first I want to clarify  that you do not have to have a real time clock to do so. I mainly use a real time clock to perform calculations on dates and times I have stored. IE: to determine the expiration date of an item. So enough of me talking, here is the example.

Im assuming,

1. Signed_out is a text box on a form bound to a table
2. Date&Time is your real time clock

In the "On click" event of your button put this.

If IsNull([Signed_out]) Then
[Signed_out].Value = [Date&Time]
DoCmd.Save

Else
DoCmd.Save

End If
End Sub

Basically what is happening, when you click the save button it checks the Signed_out text box for a value, if it contains a value it does nothing and saves the record. However if it does not contain a value, the date and time are entered into the field and the form is saved.

I did it like this because if I go back to edit my form and I save my record, I do not want to overwrite my data with a new date & time.

I Hope this helps.

Gary

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: 8/12/2026 3:08:37 PM. PLT: 0s