May i ask how i can tracking my store status, it is under status send or return.
I have create 2 data table,1st is a tbl_checker, tbl_checker is record user insert data. second is tbl_Info, tbl info is record product history. but i am no ideal how i can track my product status is under status send or return. can some one pls teaching me thanks a lot
this picture is tbl_Info
this is the coding i crate for send
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim cmd As New OleDb.OleDbCommand
If Not cnn.State = ConnectionState.Open Then
'open connection if it is not open yet
cnn.Open()
End If
cmd.Connection = cnn
'check whether add new or update
If Me.txtCID.Tag & "" = "" Then
'add new
'add data to mydatatable
cmd.CommandText = "INSERT INTO tbl_Info([CBCID],[LineNo],[Date],[Location],[OtherLocation],[PIC],[OtherPIC],[Reason],[Remarks]) " &
"VALUES('" & dgvData("cbcid", dgvData.CurrentCell.RowIndex).Value & "', '" & Me.txtline.Text & "', '" & Me.DateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss") & "', '" & Me.txtLocation.Text & "', '" & Me.txtOlocation.Text & "','" & Me.txtPIC.Text & "','" & Me.txtOtherPIC.Text & "','" & Me.txtReason.Text & "','" & Me.txtRemarks.Text & "')"
''"VALUES('" & Me.txtCID.Text & "' , '" & Me.txtline.Text & "', '" & Me.DateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss") & "', '" & Me.txtLocation.Text & "', '" & Me.txtOlocation.Text & "','" & Me.txtPIC.Text & "','" & Me.txtotherPIC.Text & "','" & Me.txtReason.Text & "','" & Me.txtRemarks.Text & "')"
'error message before save data fill textbox
If txtline.Text.Trim = "" Or txtLocation.Text.Trim = "" Or txtPIC.Text.Trim = "" Then
MessageBox.Show("Please Insert Data", "Error Message")
Exit Sub
End If
cmd.ExecuteNonQuery()
MsgBox("Add Data Successful", MsgBoxStyle.OkOnly, "Message")
Else
'error message before save data fill textbox
If txtline.Text.Trim = "" Or txtRemarks.Text.Trim = "" Then
MessageBox.Show("Please Insert Data", "Error Message")
Exit Sub
End If
cmd.CommandText = "UPDATE tbl_Info " & _
" SET" & _
" [LineNo]='" & Me.txtline.Text & "'" & _
", [Date]='" & Me.DateTimePicker1.Text & "'" & _
", [Location]='" & Me.txtLocation.Text & "'" & _
", [OtherLocation]='" & Me.txtOlocation.Text & "'" & _
", [PIC]='" & Me.txtPIC.Text & "'" & _
", [OtherPIC]='" & Me.txtOtherPIC.Text & "'" & _
", [Resason]='" & Me.txtReason.Text & "'" & _
", [Remarks]='" & Me.txtRemarks.Text & "'" & _
" WHERE [cid]=" & Me.txtCID.Tag
MsgBox("Update Data Successful", MsgBoxStyle.OkOnly, "Message")
cmd.ExecuteNonQuery()
End If
'refresh data in list
RefreshData1()
'clear form
Me.btnClear.PerformClick()
'close connection
cnn.Close()
End Sub