I had issues with allow user to enter numbers with decimals into textboxes. This is a simple way to allow only numeric values, while allowing only one decimal to be entered...

VB Code:
  1. ' USAGE
  2.  
  3. ' In Keypress event of Textbox
  4.  
  5. ForceNumeric(KeyAscii,Me.ActiveControl)
  6.  
  7.  
  8. Function ForceNumeric(KeyAscii, CONTROL As CONTROL)
  9.  
  10.     Dim intKeyAscii As Integer
  11.    
  12.     ' MAKE SURE IT'S A DIGIT
  13.    
  14.     intKeyAscii = 0
  15.    
  16.     If KeyAscii >= Asc(0) And KeyAscii <= Asc(9) Then intKeyAscii = KeyAscii
  17.    
  18.     If KeyAscii = 8 Then intKeyAscii = 8
  19.    
  20.     ' THIS ALLOWS A DECIMAL TO BE ENTERED...
  21.     ' IF ONE NOT ENTERED ALREADY
  22.    
  23.     If KeyAscii = 46 And InStr(CONTROL, ".") Then
  24.        
  25.         KeyAscii = 0
  26.    
  27.     ElseIf KeyAscii = 46 Then
  28.    
  29.         intKeyAscii = 46
  30.    
  31.     End If
  32.  
  33.     KeyAscii = intKeyAscii
  34.    
  35. End Function