billing project

saquib

, India

Joined 9 years ago

Hello friend's, i'm beginner in vb.net and creating a billing project. In that i have two forms : Customer List and Customer Bill. In Customer List i added a listbox Control and a button, when the form loads it's display the customer list from the database. so i want that when i double click on the listbox or click on the show cust. details button after selecting customer. it's display the customer bill with all relevant field in the database in the bill table. the code of Customer List Load event are:
Code:

Private Sub LoadListBox()
Dim custAdaptor As New MemorialDataSetTableAdapters.BillTableAdapter
Dim CustTable As New MemorialDataSet.BillDataTable custAdaptor.Fill(CustTable)
With lstCustomer
.Items.Clear()
.DisplayMember = "Display Name"
For Each CurrentRow As MemorialDataSet.BillRow In CustTable.Rows .Items.Add(CurrentRow.Name)
Next
End With
End Sub
Private Sub CustomerList_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
LoadListBox()
End Sub

nd show details button code are:
Code:
Private Sub btnShowDetails_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowDetails.Click
If lstCustomer.SelectedItems.Count = 1 Then
'confusion here how to load the details in bill form.
Else If lstCustomer.SelectedItems.Count = 0 Then
MessageBox.Show("You have to Select a Customer to display the details") Else
MessageBox.Show("You have Selected too many Customers")
End If
End If
CustomerBill.Show()
End Sub
so when i click on show details button it redirect to bill form and display the result. but in vb only event and raiseEvent work not redirection. so plz help me. to solve this. or plz give me a link that have solution for this. thank you