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 
Update Table
A Glenn Yesner 
     
4 years ago
I'm working on a variation of the LogOn LogOff table I saw in one of the tech help videos. I've put a text box (not visible, formatted as general date) on the cover page, which opens when the DB is opened. When the DB closes the VBA puts a record on a table leaving the UserLogOff Date/Time blank. When the DB is closed the form unloads and I'm trying to update the record with the UserLogOff Date/Time. I've tried a lot of variations of the following;

    CurrentDb.Execute "UPDATE tblLogOnOff " & _
    "SET tblLogOnOff.UserLogOff = " & "#" & Now() & "#" & _
    " WHERE tblLogOnOff.DBUser = " & UserName & " AND tblLogOnOff.UserLogOn = " & "#" & Logon & "#"


but I can't quite get it. The latest error message states
"Run-time error '3061':
Too few parameters. Expected 2."

I'm thinking it's something with the double, double quotes and I've tried a number of variations. Any help appreciated.  Ed
A Glenn Yesner OP  @Reply  
     
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
WHERE tblLogOnOff.DBUser =""" & UserName & """

What do you get with this?
A Glenn Yesner OP  @Reply  
     
4 years ago
I must have tried a hundred or more permutations, except that one. That did  the trick. Thank you very much.  Ed

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/7/2026 8:18:13 AM. PLT: 1s