What is the error in this section of code?

Enderscz
Enderscz used Ask the Experts™
on
Dim scholar As Student
Private Sub btnGo_Click(...) Handles btnGo.Click
   Dim firstName as String
   scholar.Name = "Warren"
   firstName = scholar.Name
End Sub
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You should click on "Request Attention" and tell them what language you are using so your question will be put in the right zone.
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009
Commented:
"scholar" has NOT been instantiated before you use it.

Change:

    Dim scholar As Student

To:

    Dim scholar As New Student

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial