So far i have a code that only allows you to enter numbers but how do i limit the value from 0 - 9999.
Also how would i be able to display a message label if the user is doing something illegal. Right now i have the messagebox setup but i need to display a error label.
Private Sub empIDbox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles empIDbox.KeyPress
'Makes sure only numeric values are entered
If (e.KeyChar < Chr(48) Or e.KeyChar > Chr(57)) And e.KeyChar <> Chr(8) Then
e.Handled = True
addBtn.Enabled = False
MessageBox.Show("Please enter only numeric values from 0 - 9999")
addBtn.Enabled = True
End If
End Sub
THanks for your help