Convert String to Double

I need to convert the data entered into a textfield on a form to Double. I have the following code:

 dim dA            As Double
 dim dB            As Double
  
  dim dLinearFeet   As Double
  dim dSquareFeet   As Double
  dim dAcres        As Double
   
  dA = CType(tfA.Text, Double)
  dB = CType(tfB.Text, Double)
 
  dSquareFeet = dA * dB
  tfSquareFeet.Text = Str(dSquareFeet)

But on compile I get:
Type mismatch error. Expected Double, but got String
dA = CType(tfA.Text, Double)

So how is the best way to convert string to double???

thanks

Dim d As Double
d = Val(“10,000.95”)

thanks much, but why doesn’t CType work. I used it just like the language reference stated…

CType just reinterprets the bits. Val/CDbl parse the characters in the string.

You can also take a look at CDbl

[quote]Use Val if you control the string that is passed, and use CDbl if the string comes from the user.
You should use CDbl instead of Val if the string contains separators.[/quote]

dim dA            As Double
dim dB            As Double
  
dim dLinearFeet   As Double
dim dSquareFeet   As Double
dim dAcres        As Double
   
  dA = CDbl(tfA.Text)
  dB = CDbl(tfB.Text)