Is what you posted, your actual code? If so, add Option Explicit to the top of your form & press Ctrl+F5. Any errors? If so those, need to be addressed first.

Second. What is X? You use it quite often but it is not declard anywhere. Not only that, but you are freely using it as a loop variable, some input type variable and an array index -- this is going to cause you issues.

Third, as dilettante pointed out, why do you have amount() as an array? Your app will only have one amount value, ever, correct? Therefore, make it easier on yourself and declare Amount as a Long, not as an array.