0
IsConnected("Select count(ID) from transaction", False)

            If myDR.Read = True Then
                Me.TextBox1.Text = myDR.GetValue(0) + 1
            Else
                Me.TextBox1.Text = 1
            End If
            TextBox1.Focus()
        End If

im going to ask how can i make my autonumber like these "10001" instead of "1"

can anyone help me to fix my code??

3
Contributors
2
Replies
7
Views
6 Years
Discussion Span
Last Post by codeorder
0

Surely you couldn't just add 10,000.

What is your ID column? is it an identity column. If it is couldn't you just start the seed at 10001.

If its and your using it as an identity: count(id) is not very good. You would be better with max(id). You'll run into issues where the count could be 10 and assign it to something then something gets deleted and something gets added and the next value from count(id) will be 10 as well.

Not exactly sure what your doing. Go ahead and post some more.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.