The code does not "know" where to look outside the form - so you need to be explicit, something like :-
Userform1.txtPartNumber.Value = ""
(it is not a good idea to use "reserved words" as variable names.
ie. words that Excel uses already. In this case 'Userform' is an object type. We can often get away with it, but as a project grows the code can start giving errors.)