Computer Learning Zone CLZ Access Excel Word Windows

If you cannot control yourself, you cannot command others

-Klingon Proverb
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Access >
Back to TechHelp    Comments List
Upload Images   Link   Email  
Product Numbers
Richard Van Wagoner 
      
38 days ago
I am starting a new database but have run into a problem. I have created a table and form for my products. And I want to add an automatic product number for each product incremented by one. I have one product in my table that I have given the product number of 1001. But when I add the next the number given is 1 and the next one is also 1. I have some screen shots of the code I have. Can you tell me what I have done wrong?
Richard Van Wagoner OP 
      
38 days ago

Richard Van Wagoner OP 
      
38 days ago

Adam Schwanz 
            
38 days ago
Add some Msgbox LargestProductNumber along the way to see what it's set to. Or step into the code and see the values. Make sure it's finding the correct starting point, and adding 1 to it.

Is ProductNumber a number or text?
Adam Schwanz 
            
38 days ago
Also what is the second textbox / field for? The AssignNextProductNumber.

Your code could be dumbed down a lot to be simpler
If Not IsNull(ProductNumber) Then
Msgbox "Already"
Exit Sub
End If

ProductNumber = NZ(DMAX("ProductNumber","ProductT"),0)+1
Richard Van Wagoner OP 
      
38 days ago
Thanks I just changed the last line and it works fine now
Kevin Robertson 
           
38 days ago

Kevin Robertson 
           
38 days ago
Oh. Guess I was too slow. LOL
Richard Van Wagoner OP 
      
38 days ago
That's Fine, you have added a little more information on how to start with a specific number. Thank you

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

 
 
 

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 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/13/2024 3:54:32 PM. PLT: 1s