i just want to increment id inserted with the limit equal to other table
i have no problem with that
the only problem is that, i cant code increment on id until the limit
id column 2
1-----------0
2-----------5
3-----------0
and so on, like this, by cliking insert button,the id should increment one by one til the limit
can anyone please help me
RecordDate.Text = MyFormat
Dim antinull As Integer = Format(0)
BadBeg.Text = antinull
WarePcs.Text = antinull
CustPcs.Text = antinull
Returned.Text = antinull
BadEnd.Text = antinull
Try
Str = "insert into BadWarehouseInv values("
Str += Id.Text.Trim()
Str += ","
Str += """" & RecordDate.Text.Trim() & """"
Str += ","
Str += """" & BadBeg.Text.Trim() & """"
Str += ","
Str += WarePcs.Text.Trim()
Str += ","
Str += CustPcs.Text.Trim()
Str += ","
Str += Returned.Text.Trim()
Str += ","
Str += """" & BadEnd.Text.Trim() & """"
Str += ")"
Con.Open()
Cmd = New OleDbCommand(Str, Con)
Cmd.ExecuteNonQuery()
Dst.Clear()
Dad = New OleDbDataAdapter("SELECT * FROM BadWarehouseInv ORDER BY Id", Con)
Dad.Fill(Dst, "stock")
Con.Close()
Catch ex As Exception
MessageBox.Show("Could Not Insert Record!!!")
MsgBox(ex.Message & " - " & ex.Source)
Con.Close()