Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command_Click doens't work

Status
Not open for further replies.

Flupke

Programmer
Jun 26, 2002
94
BE
This code runs under a command button:

Private Sub cmdResultaatTicketVerkooplijnVerwijderen_Click()

If MSFlexGridTicketResultaat.Rows > 2 Then
MSFlexGridTicketResultaat.RemoveItem (MSFlexGridTicketResultaat.Row)
MSFlexGridTicketResultaat_opbouwen
Else
cmdResultaatLeegmaken_Click
End If
MSFlexGridTicketResultaat.HighLight = flexHighlightNever
cmdResultaatTicketVerkooplijnVerwijderen.Enabled = False

End Sub

When clicking the CommandButton, this code isn't even executed. I put a breakpoint and the programm doesn't even proceed any of that code!



In my Form_Keypress, I have the following code (the Form KeyPreview is set to True):

Private Sub Form_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case Asc("V"), Asc("v")
KeyAscii = 0
If cmdResultaatTicketVerkooplijnVerwijderen.Enabled Then
cmdResultaatTicketVerkooplijnVerwijderen_Click
End If
End Select

End Sub

When pushing the "V", the code is then executed correctly!

How is this possible???

Many thanks for your kind help,

Michel

 
The name, cmdResultaatTicketVerkooplijnVerwijderen, is 40 characters long. The VB help says 40 is the maximum length for a name. This means the sub cmdResultaatTicketVerkooplijnVerwijderen_Click might be too long for the system to process. I'm not sure if this is your problem, but you could try giving the command button a shorter name.
 
Yhank you for your reply. With a shorter name, the problem is clearly solved.
But what I don't understand is that the procedure with the 40-character name works fine, when it is called through the form_keypress. The name of the procedure then called is still over 40 characters long.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top