I've been working on a very basic windows form program. using VB.net. when I run the program I get the error: System.NullReferenceException
with the lines of code:
Private Sub CreatetxtBox(ByVal truckCurrent As Integer, ByVal deliverycurrent As Integer, ByVal pnt As Point)

txtTruck(truckCurrent, deliverycurrent) = New TextBox
txtTruck(truckCurrent, deliverycurrent).Visible = True
txtTruck(truckCurrent, deliverycurrent).Size = New System.Drawing.Size(txtboxwidth, txtboxhight)
txtTruck(truckCurrent, deliverycurrent).Location = pnt

End Sub

my variables are something as folows:
txtboxwidth = 75
txtboxhight = 40
truck current = 0 to 6
delivery current = 0 to 5

if anyone can tell me, or point me in the right dirrection on this, I would be very thankful