non hai specificato che linguaggio di programmazione...prima di postare leggere il regolamento...

se usi VB...

Private Sub txt_KeyPress(KeyAscii As Integer)
If InStr("'", Chr$(KeyAscii)) > 0 Then KeyAscii = 0
End Sub

cmq consulta le F.A.Q.