Jump to content
Xtreme .Net Talk

Karzack

Members
  • Posts

    2
  • Joined

  • Last visited

About Karzack

  • Birthday April 22

Personal Information

  • Visual Studio .NET Version
    Visual Basic .NET
  • .NET Preferred Language
    VB.NET

Karzack's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. *sighs* I just forgot to redim the array. :o Thank you. Value for pg was set before sub was called. *muddles under his breath*
  2. Hello, Im new to programming in general. Did a little on apple IIE's but that wasn't much. I have desiced to try to learn again with vb.net and ran into something. I'm learning with the "Visual Basic .NET Step by Step" book. When I try to add a value to a variable in a structure I get an error. An unhandled exception of type 'System.NullReferenceException' Additional information: Object reference not set to an instance of an object. Example: Trying to make a small address book. This structure and the sub are in the module. frmAdd is the form that information is added to the address book. Structure Person Public firstName As String Public middleName As String Public lastName As String Public homeNumber As String Public email As String Public address As String Public city As String Public state As String Public workNumber As String Public cellNumber As String Public photo As Image End Structure Public page() As Person ' Array for number of people in book Public pg As Short ' value to determine how many pages Sub pageFill() page(pg).firstName = frmAdd.txtFirstName.Text ' < error here page(pg).middleName = frmAdd.txtMiddleName.Text page(pg).lastName = frmAdd.txtLastName.Text page(pg).homeNumber = frmAdd.txtHomeNumber.Text end sub Didn't put in the rest of the sub because it was the same as the first few lines. Anyway. When I type in the values in the text boxes and hit the button that calles this sub. I get the error described above. At the first line of the sub. I think I need to back off coding for now, I have a headache. :( I have done some tread searching but didn't come up with anything.
×
×
  • Create New...