Im sorry if the title made you confused
my current code:
*Press and hold the button
*Execute the code repeatedly until I stop pressing that button
i need my code to be:
*Press and hold the button
*Execute the code ONCE
Here's the code I use:
Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 113 'q +2M
If Label8.Caption = "p1" Then
If Command1(0).Enabled = True Then
Call Command1_Click(0)
'tried this code (keyascii = 0) for this LINE but it doesnt work
'also tried (exit sub) but still doesnt solve the problem :(/>
'anyone can suggest good solution for this problem
End If
ElseIf Label8.Caption = "p2" Then
If Command1(47).Enabled = True Then
Call Command1_Click(47)
End If
ElseIf Label8.Caption = "p3" Then
If Command1(119).Enabled = True Then
Call Command1_Click(119)
End If
ElseIf Label8.Caption = "p4" Then
If Command1(95).Enabled = True Then
Call Command1_Click(95)
End If
ElseIf Label8.Caption = "p5" Then
If Command1(71).Enabled = True Then
Call Command1_Click(71)
End If
End If
End Select
End Sub
Any suggestions or corrections will be much appreciated

New Topic/Question
Reply



MultiQuote





|