Quote Originally Posted by Mustaphi View Post
Hello again Krool
I need to allow only numeric values and the decimal point in column 2 but this code doesn't seem to work
Code:
Private Sub VBFlexGrid1_KeyPress(KeyChar As Integer)
With VBFlexGrid1
      If .Col = 2 Then
          Select Case KeyAscii
        Case vbKey0 To vbKey9
        Case Asc(".")
   Case Else
            KeyAscii = 0
    End Select

  End If
  End With
End Sub
thank you
With so little context it is difficult to help.

I assume you are referring to user editing a cell ? If yes, then KeyPress is the wrong event. Probably EditKeyPress event is what you are looking for.
Also to note is that KeyAscii got renamed to KeyChar in my events.