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 WagonerOP 38 days ago
Richard Van WagonerOP 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
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
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.