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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Update field value on load
Kerwin Tarroza 
    
4 years ago
HI I have a field value that i would like to update automatically when load by using date add function. how do i make the form update when opening
Kerwin Tarroza OP  @Reply  
    
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
You could use the On Load event or the On Current Event.
Kerwin Tarroza OP  @Reply  
    
4 years ago
Thanks Adam, it only updated the first record on top? how do i update all the record?
Adam Schwanz  @Reply  
           
4 years ago
Oh yea, that is going to be more advanced. Probably the easiest way would be a recordset, loop through all your records and apply the formula. That might be beyond your VBA knowledge now, I believe recordsets are first covered in Access Developer 16.

Basically would be something like
dim rs as recordset
rs = currentdb.openrecordset("Select * From Table where Enter your Crtieria")
while not rs.eof
'whatever formula you want to apply to the fields, like rs!DateField=Date()
rs.movenext
wend
rs.close
set rs = nothing
Richard Rost  @Reply  
          
4 years ago
You could just use a simple RunSql statement. No need for a recordset.
Adam Schwanz  @Reply  
           
4 years ago
Recordset is #1 Rick.
Adam Schwanz  @Reply  
           
4 years ago
In fact, I think we'd all be better off if we just wrote a recordset for every single field.

rs = Currentdb.openrecordset("Select * from customerT where CustomerID=1")
while not rs.eof
rs.Edit
rs!Name=InputBox("Enter Value")
rs.update
rs.movenext
wend
rs.close
set rs=nothing

on EVERY field, there's no such thing as going to far right...
We don't just do
Name="John" here, too easy
Richard Rost  @Reply  
          
4 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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 6:27:25 AM. PLT: 1s