HOW to solve "Compile error: Type mismatch" with own file ocx in VB6

125 Views Asked by At

I have an ActiveX named GridEntry.ocx I found it from the download link GridEntry.ocx

I want to use it to make a software. but I'm having trouble, and getting an error message. "Compile error: Type mismatch" my code

Private Sub GridEntry1_KeyPress(KeyAscii As Integer, Row As Integer, Col As Byte)
If KeyAscii = 13 Then
Post = GridEntry1.CellFocus(0, 1)
 With GridEntry1
  .Caption = "TEST"
  End With
End If
End Sub
1

There are 1 best solutions below

3
Volkan ŞABAHAT On BEST ANSWER

Use this

Private Sub GridEntry1_KeyPress(KeyAscii As Integer, Row As Integer, Col As Byte)
If KeyAscii = 13 Then
Call  GridEntry1.CellFocus(0, 1)
 With GridEntry1
  .Caption = "TEST"
  End With
End If
End Sub