Convert string to integer

  • Thread starter Thread starter h3llz
  • Start date Start date
H

h3llz

productPrice = Val(txtProductPrice.Caption)

productPrice is dimmed as integer.
txtProductPrice.Caption is £25 and i want to get 25 out of it.
Help please :(
 
productPrice = Val(txtProductPrice.Caption)

productPrice is dimmed as integer.
txtProductPrice.Caption is £25 and i want to get 25 out of it. Help
please :(

productPrice = CInt(Mid(txtProductPrice.Caption,2))
 
productPrice = CInt(Mid(txtProductPrice.Caption,2))

Which leads to the question of why is the poster using a label to
store this gtext value, rather than a text box storing the value as an
integer (or more likely better, as Currency datatype)?
 
I have a problem with a textbox having a caption. Is txtProductPrice a
label? Anyway,
how about:
productPrice=CCur(txtProductPrice.Caption)

Damon
 
thanks

the reason a label is containing the information because when i select a
product then click get product, it will get all product information then i
have a button add ot basket, why do another query to get the product
information when its in a label? =]

Damon Heron said:
I have a problem with a textbox having a caption. Is txtProductPrice a
label? Anyway,
how about:
productPrice=CCur(txtProductPrice.Caption)

Damon
 
Back
Top