想知道如何使用keyboard(編號:8496)

各位我的問題是這樣的.....
我正在寫一個交通燈的program
老師吩咐我們當program 被run時
只按keyboard的 TAB 鍵就可以轉燈.....
因為我是初哥....
就連loop我也不知如何使用......
各位可以幫我一把嗎?
下面是我寫的「不清不楚」未完成program的部份....
請指點指點
Private Sub Command1_Click()
End
End Sub
Private Sub Command1_KeyPress(KeyAscii As Integer)

If (KeyAscii = 9) Then
For N = 1 To 50000
Shape1.BackColor = QBColor(12)
Shape2.BackColor = QBColor(8)
Shape3.BackColor = QBColor(8)
DoEvents
Next N
For N = 1 To 50000
Shape1.BackColor = QBColor(12)
Shape2.BackColor = QBColor(14)
Shape3.BackColor = QBColor(8)
DoEvents
Next N
For N = 1 To 50000
Shape1.BackColor = QBColor(8)
Shape2.BackColor = QBColor(8)
Shape3.BackColor = QBColor(10)
DoEvents
Next N
For N = 1 To 50000
Shape1.BackColor = QBColor(8)
Shape2.BackColor = QBColor(14)
Shape3.BackColor = QBColor(8)
DoEvents
Next N
For N = 1 To 50000
Shape1.BackColor = QBColor(12)
Shape2.BackColor = QBColor(8)
Shape3.BackColor = QBColor(8)
DoEvents
Next N
DoEvents
KeyAscii = keyacii + 1
Else
Exit Sub
End If
End Sub