Kmax
Newcomer
Greetings,
I get " 'sub Main' was not found in Structure.' error when I attempt to compile this. Why am I getting this error?
I get " 'sub Main' was not found in Structure.' error when I attempt to compile this. Why am I getting this error?
Code:
Public Structure customer
'members...
Public fName As String
Public lName As String
Public eMail As String
End Structure
Code:
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
'create a new customer...
Dim testCustomer As customer
testCustomer.fName = "Amir"
testCustomer.lName = "Aliabadi"
testCustomer.eMail = "amir@pretendcompany.com"
'Display the company...
displayCustomer(testCustomer)
End Sub
'DisplayCustomer - show the customer...
Public Sub displayCustomer(ByVal customer As customer)
'update the fields...
txtfName.Text = customer.fName
txtlName.Text = customer.lName
txtEMail.Text = customer.eMail
End Sub