JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: data aware class Archived to Disk
As far as why you're trying to use a class module for a data source, I'm not too sure as to what you're looking for so I don't know what to suggest.
As for the text box... You want to limit the input to numbers, doubles, or strings... That's the only thing that the text box can have inputed (unless using the alt-numeric keypad for the full 255 characters). But I think the following may help:
Private Sub Text1_KeyPress(KeyAscii As Integer)
' The following will only allow a-z, A-Z, 0-9, and "." but nothing else
' To only allow numbers, only have the asc("0") to asc("9") line
Select Case KeyAscii
Case Asc("a") To Asc("z")
Case Asc("A") To Asc("Z")
Case Asc("0") To Asc("9")
Case Asc(".")
Case Else
KeyAscii = 0
End Select
End Sub
|