Vithchea Try Vithchea Try - 1 month ago 16
Vb.net Question

VB.net auto number increase even after close form

I have trouble to increase the number of my codex. Example: I have this kind of codex JJ01 where 01 will keep increasing every time new data type in. I understand that you can

dim i as integer
and use
i += 1
but that will be reset once I closed the form.

I try the other way around by using ID from database and take it +1 but that will be a long way as you need to open database take ID and keep on some textbox and plus it with 1 change back to string.

Therefore, is there any other way to do that?

Answer

Create the ID the Settings of your Project, so you can access it via My.Settings.ID.

More Info on MSDN