'ENTER PLAYERS NAME FORM txtName0, txtName1, txtName2 Option Explicit Private A As Integer Private mblnErrorBlank As Boolean Private mblnErrorRepeat As Boolean Private Sub cmdPlayersOkay_Click() '<-- Check if there are any blanks, open error form if there are mblnErrorBlank = False mblnErrorRepeat = False For A = 0 To 2 If txtName(A).Text = "" Then mblnErrorBlank = True Next A If mblnErrorBlank = True Then frmEnterPlayers.Hide Load frmErrorBlank frmErrorBlank.Show End If '<-- Check if there is any repeated name usage If txtName(0).Text = txtName(1).Text Then mblnErrorRepeat = True If txtName(0).Text = txtName(2).Text Then mblnErrorRepeat = True If txtName(1).Text = txtName(2).Text Then mblnErrorRepeat = True If mblnErrorRepeat = True Then frmEnterPlayers.Hide Load frmErrorBlank frmErrorBlank.Show End If '<-- Convert text in boxes to string variables if test passes If mblnErrorBlank = False And mblnErrorRepeat = False Then For A = 0 To 2 gstrName(A) = txtName(A).Text Next A End If '<-- Load interface form if tests pass, close EnterNames window If mblnErrorBlank = False And mblnErrorRepeat = False Then Unload Me Load frmInterface frmInterface.Show End If End Sub
Thanks,
Todd
Mod Edit: Please use code tags when posting your code. Code tags are used like so =>
Thanks,
PsychoCoder
This post has been edited by PsychoCoder: 06 August 2008 - 08:54 PM

New Topic/Question
Reply




MultiQuote




|