Adding, searching and updating of records

guo84

Member
Joined
Feb 7, 2009
Messages
6
Programming Experience
1-3
Hi All,

Understand this is a repeated topic. But I am not able to get the solution.

In the first form I am trying to add a record.

Coding:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click

Dim clientid As Integer
Dim orderid As Integer

If cboClient.SelectedItem = "" Then
MessageBox.Show("Please select a client ID.", "Error")

ElseIf txtid.Text = "" Then
MessageBox.Show("Please enter valid Order ID.", "Error")

ElseIf txtLoc.Text = "" Then
MessageBox.Show("Please enter a Transplanting Location.", "Error")

ElseIf cbotree.SelectedItem = "" Then
MessageBox.Show("Please select a Tree Species.", "Error")

ElseIf txtQty.Text = "" Then
MessageBox.Show("Please enter a Quantity.", "Error")

ElseIf IsNumeric(txtid.Text) And IsNumeric(txtQty.Text) Then
MessageBox.Show("Order Submitted for process.", "Add Order")
clientid = cboClient.Items.Add(cboClient.Text)
orderid = Me.txtid.Text
Else
MessageBox.Show("Invalid data is added.", "Error")
End If
End Sub

In the second form I want to search for the record and update the record.

Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch.Click
Me.txtid.text = orderid

End Sub

I am struggling on how to pass data from first to second form and updating record.
No connection to database.
Please help. Thanks.

:(
 
Back
Top