I am not familiar with VBA, but seems like my code is wrong, please advise me how to fix these codes.

VB Code:
  1. Dim cbBox As Control
  2.    
  3.     For Each cbBox In [Form_Barclaycard Ladies Entry - Images_v2]
  4.       Dim intAttempt As Integer
  5.       Dim intAttemptPrevious As Integer
  6.       Dim intAttemptFuture As Integer
  7.       For intAttempt = 1 To 10
  8.          If cbBox.Name = "Attempt" & CStr(intAttempt) & "Com" Then
  9.                If cbBox.Text = "" Then
  10.                   cbBox.Locked = False
  11.                   cbBox.BackColor = -2147483643
  12.                Else
  13.                   For intAttemptPrevious = intAttempt To 1
  14.                      cbBox.Locked = True
  15.                      cbBox.BackColor = 16777164
  16.                   Next
  17.                   For intAttemptFuture = (intAttempt + 1) To 10
  18.                      cbBox.Locked = True
  19.                   Next
  20.                End If
  21.          End If
  22.       Next
  23.     Next