Kmax Posted May 6, 2003 Posted May 6, 2003 Greetings, I get " 'sub Main' was not found in Structure.' �error when I attempt to compile this. Why am I getting this error? Public Structure customer 'members... Public fName As String Public lName As String Public eMail As String End Structure 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 Quote
*Experts* Nerseus Posted May 6, 2003 *Experts* Posted May 6, 2003 Check your project properties. See what the Startup Object is set to. If you're creating a Windows Application you'll need a Sub Main or a startup form. If you create a new project you can see what Sub Main should look like. You can then cut and paste that function to your real project and change the form that's referenced there. If you still can't get this to work, upload a zip of your project and we'll get you going. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.