I am making a simple game, and am having difficulty using a small form to set the name of the player. The name variable is part of a class called 'Player' and is currently set as a public variable (happened during my debugging process). the player-class variable Player1 is declared as public on the form frmDungeonQuest, which is the first form loaded and only get hidden, never unloaded. Here's the code for the name input button:
Dim temp As String
temp = txtName
frmDungeonQuest.Player1.Name = temp
'error occurs in above line
Counter = Counter + 1
If (frmDungeonQuest.NoPlayers = 1) Then
frmDungeonQuest.Show
Me.Hide
End If
Every time I get the RunTime error 91. Any Ideas?
Dim temp As String
temp = txtName
frmDungeonQuest.Player1.Name = temp
'error occurs in above line
Counter = Counter + 1
If (frmDungeonQuest.NoPlayers = 1) Then
frmDungeonQuest.Show
Me.Hide
End If
Every time I get the RunTime error 91. Any Ideas?