Computer Learning Zone CLZ Access Excel Word Windows

A good education is a foundation for a better future.

-Elizabeth Warren
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Visitor Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
How to update a value in vba
Jim Kohlhoefer 

4 years ago
I have a csv file of orders I want to import into my acct program. The problem I have is updating the invoice number field. I know the code to pull the last invoice number from my invoice table, but then I need to loop through my csv import table and update the invoice number field so the numbers are sequential. For instance, if the last invoice number in the invoice table is 7500 and there are 50 records in the import table, then I need to start at the next value 7501 in this case and assign that value to the invoice number field in the csv file incremented by 1. The number of records in the import table vary, so I assume I need some kind of loop. I'm using Access 2003. Thank you for any assistance.
Scott Axton  @Reply  
        
4 years ago
If you don't feel comfortable with VBA bring your CSV into Excel and fill in the Order number using Fill Series.  Save it and do your import to Access.

Easy if you know a bit of VBA.  
DMax your Last Invoice number and place it into a
Variable and add 1.

Then use a For Next Loop to update each record either as you are importing it or in a temp table prior to importing it.

Honestly the best way in my mind would probably be to use a recordset but that is a bit more advanced and I don't know your knowledge level.  Those are covered starting in Access Developer 16

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visitor 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 8:30:52 AM. PLT: 0s