You have the USno as an integer Dim USNo As Integer but you are
testing for "".
You could set the variable to a variant which should get you going, or
you could test for "" in the text box then change the value to an
integer.
USno = CInt(txtUSNo.text)