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:

Private Sub LoadListBox() 
Dim custAdaptor As New MemorialDataSetTableAdapters.BillTableAdapter 
Dim CustTable As New MemorialDataSet.BillDataTable custAdaptor.Fill(CustTable) 
With lstCustomer 
.DisplayMember = "Display Name" 
For Each CurrentRow As MemorialDataSet.BillRow In CustTable.Rows .Items.Add(CurrentRow.Name) 
End With 
End Sub 
Private Sub CustomerList_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
End Sub
nd show details button code are:
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 
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

Edited by Nick Evan: Added code-tags

7 Years
Discussion Span
Last Post by me655321

Should be able to just populate the items on CustomerBill with the info. If you have a Textbox named Textbox1 on your CustomerBill form you do

CustomerBill.Textbox1.Text = "sometext"
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.