Hi guys..silly question

All I want is to assign a text box value to a variable as follows:

Dim d As Integer

d = Val(txtBD.Text)

Keeps telling me the value of d is 0 even if the text field is say 10000.

What I'm I doing wrong!!!

Gerard