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
@Reply 2 years 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.