i have a problem about the autonumber for my ID in database....
i try to run but there's no number come out with my booking no text....type a number before it will show to my database..
i just need to change the properties of my ID autonumber to a number and it will come out manually....
the image will show the error..
here's the code
Private Sub btnaddnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaddnew.Click
Dim cmd As New OleDb.OleDbCommand
If Not cnn.State = ConnectionState.Open Then
cnn.Open()
End If
cmd.Connection = cnn
If Me.txtID.Tag & "" = "" Then
cmd.CommandText = " INSERT INTO reserv (id, checkcon, datebook, Occasion, dateevent, octime, Place, Cperson, Phone, Package, Quote) " & _
" VALUES(" & Me.txtID.Text & ",'" & Me.txtcheckcon.Text & "','" & _
Me.dtpdatebooked.Text & "','" & Me.cbboccasion.Text & "','" & _
Me.dtpdateevent.Text & "','" & Me.txttime.Text & "','" & _
Me.txtplace.Text & "','" & Me.txtcperson.Text & "','" & _
Me.txttell.Text & "','" & Me.txtpackage.Text & "','" & _
Me.txtquote.Text & "')"
cmd.ExecuteNonQuery()
MsgBox("Record Save")
End If
RefreshData()
Me.btnclear.PerformClick()
cnn.Close()
End Sub
sorry for a lot of question i'm newbie in this language...
can anyone give some sample code or advice about this
i try to run but there's no number come out with my booking no text....type a number before it will show to my database..
i just need to change the properties of my ID autonumber to a number and it will come out manually....
the image will show the error..
here's the code
Private Sub btnaddnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaddnew.Click
Dim cmd As New OleDb.OleDbCommand
If Not cnn.State = ConnectionState.Open Then
cnn.Open()
End If
cmd.Connection = cnn
If Me.txtID.Tag & "" = "" Then
cmd.CommandText = " INSERT INTO reserv (id, checkcon, datebook, Occasion, dateevent, octime, Place, Cperson, Phone, Package, Quote) " & _
" VALUES(" & Me.txtID.Text & ",'" & Me.txtcheckcon.Text & "','" & _
Me.dtpdatebooked.Text & "','" & Me.cbboccasion.Text & "','" & _
Me.dtpdateevent.Text & "','" & Me.txttime.Text & "','" & _
Me.txtplace.Text & "','" & Me.txtcperson.Text & "','" & _
Me.txttell.Text & "','" & Me.txtpackage.Text & "','" & _
Me.txtquote.Text & "')"
cmd.ExecuteNonQuery()
MsgBox("Record Save")
End If
RefreshData()
Me.btnclear.PerformClick()
cnn.Close()
End Sub
sorry for a lot of question i'm newbie in this language...
can anyone give some sample code or advice about this